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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PROC MEAN

Status
Not open for further replies.

charlise

Technical User
Oct 14, 2003
63
US
I am VERY new to SAS, and I need to run some descriptive statistics on a data set. I have a column that contains different drugs and a colum that contains the dosage of these drugs. So my data looks like:

Drug Dosage
Tylenol 5
BC 6

and I need to know stats about the dosage by each different drug. Is this possible? Why don't I get any results when I run PROC MEAN?
 
Post your Proc step and let us have a look. Do you have multiple records for each drug?
 
I dont suppose it could be as simple as

Proc means;run;


New users frequently fail to add the run; piece.

dje
 
Adding run; isn't strictly speaking necessary, as the step will execute when it hits the next proc or datastep, so that probably isn't the problem (though it is possible).
 
Charlise,
nirmalraj is right you use the Proc Means for that type of stats, but you need to convert your stats to numeric form. (if you want to know freqs you can get that even in text format by using the proc freq routine)
You should do a few setup steps like converting and sorting your data. Here is what I would do.
1) Convert your data to numeric format.
i.e. dosage values to int
ex. numdosage = input(dosage,??8.2);
2) Sort your data by drug for example perhaps another variable as well.
Then in your proc means use the BY statement and execute the routine. This should give you a lot of usefull stats. for more advanced statistics consult your local stats guy or SAS online help.


I hope that this helps.
Klaz
 
Proc Tabulate also gives some nice summary/statistical results for small tables of data (without a whole lot of work). But it is more for the final report where Means is great if you need to pass the info along.
 
If you are looking for even more thourough stat analysis, try proc univariate; run; just to see what you come up with. You can also generate a histogram out of that as well.

proc univariate data=test cibasic(type=twosided alpha=.003)noprint;
var dosage;
class drug;
histogram dosage / normal(color=black w=4 noprint)
vscale = count
cbarline=black
cfill = blue
cframe = white;
inset n="N" (5.0)
mean="Mean" (5.1)
median="Median" (5.1)
std = "Std Dev" (5.1)
/pos =ne height=3;
run;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top