Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

statistical analyses by group

Status
Not open for further replies.

newprogram

Programmer
Jul 27, 2006
8
0
0
US
Hi, All,

I am tring to do descriptive analyses which include mean, median, minimum, maximum, standard deviation/errors by the following Group:

GROUP 0 (control CHD=congenitial heart disease)
GROUP 0&3 together (all CHD)
GROUP 1&2 together (all preterm)
GROUP 1 (preterm no lesion)
GROUP 2 (preterm lesion)
GROUP 3 (CHD-lesion and/or low MDI)

the dataset is like that:

NAA MDI PDI ABST2 GROUP...
0.90 88 78 100 0
0.78 56 62 93 1
0.87 99 103 110 2
0.98 109 98 123 3
0.89 84 80 79 1...


I don't know how to solve this problem using SAS or SPSS.

Thanks for advices,
JW




 
newprogram,

Use the UNIVARIATE proc (see the SAS online help how to use this proc). You will have to prepare your dataset for your specific needs.
First you will have to create a new variable say, group2 and classify group 0 & 3 as group2 = 1 and group 1 & 2 as group2=2.
Run a proc sort on your dataset. Sort by group, group2. Then run the univariate using group as your by group. Repeat this for group2 results.
I haven't tried your data but here is how I would attack this problem

Code:
data testdata;
  set yourdata;
  if group = 0 or group = 3 then
    group2 = 1;
  if group = 1 or group = 2 then
    group2 = 2;
run;
proc sort
  data = testdata
  out  = testdatas;
  by group group2;
run;
proc univariate data = testdatas all;
by group;
var NAA MDI PDI ABST2;
run;
proc univariate data = testdatas all;
by group2;
var NAA MDI PDI ABST2;
run;


You probably can combine these tasks but that takes much more time.

I hope that this helps.
Good luck
Klaz
 
Also, look at Proc Summary.
Code:
proc summary data=mydat;
  class group;
  output out=sum_dset;
run;
You'll need to look up the meaning of the _type_ variable in the online doco as this is very important. (the doco is under "Proc Means" as this is the same as proc summary, except Mean produces printed output by default and summary doesn't.)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top