- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
Could you please advise what SAS procedure can complete all this analysis?
Timepoint
Statistic
--------------------------------------
Pre-Dose
n
Arithmetic Mean
Geometric Mean
SD
%CV
Geometric %CV
Min
Median
Max
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Except for the geometric mean and geometric cv, you can get all the others with proc means.
And if you create a LN_X= log(X) = the natural log of X, then submitting both X and LN_X to proc means would generate all the non-geo stats for X, and also the a set of stats for LN_X, including its mean and std.
Just exponentiate the mean of LN_X to get geometric mean of X.
As to "geometric %cv", as to https://en.wikipedia.org/wiki/Coefficient_of_variation, you can take the std of LN_X (call it std_lnx), and generate the geometric CV:
geo_cv = sqrt{exp[std_lnx**2]-1}
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set
Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets
--------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
PROC MEANS or SURVEYMEANS.
For geometric mean, create a log() of the variable and then use that variable with the mean.
You can look up the definition to see how this would work.
Otherwise, both procedures can calculate all the statistics you've listed.
Please post it as text in the future, it's hard to read images and there's nothing confidential in your image.
@DmytroYermak wrote:
Hi all,
Could you please advise what SAS procedure can complete all this analysis? Or it should be several ones?
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Except for the geometric mean and geometric cv, you can get all the others with proc means.
And if you create a LN_X= log(X) = the natural log of X, then submitting both X and LN_X to proc means would generate all the non-geo stats for X, and also the a set of stats for LN_X, including its mean and std.
Just exponentiate the mean of LN_X to get geometric mean of X.
As to "geometric %cv", as to https://en.wikipedia.org/wiki/Coefficient_of_variation, you can take the std of LN_X (call it std_lnx), and generate the geometric CV:
geo_cv = sqrt{exp[std_lnx**2]-1}
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set
Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets
--------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you!
I have coded as you recommended:
*...**;
LN_PCORRESN=log(PCORRESN);
*...**;
proc means data=pretable2 mean std cv min median max;
var PCORRESN LN_PCORRESN;
class PCSEQ TRT01AN;
run;
*...**;
data pretable4;
set pretable3;
Geom_mean=exp(LN_PCORRESN_Mean);
run;
Just one question left:
You provided the following formula of Geometric %CV:
geo_cv = sqrt{exp[std_lnx**2]-1}
On the same time in the in the programming specification I have found the following one:
CV% geo-mean = sqrt (exp (variance for log transformed data)-1)*100.
Just one question left: Is the 'variance for log transformed data' equal to 'std_lnx**2'? Or " **2 " was missed in the specification formula?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
A variance is the square of the standard deviation, so both formulas are correct.
The "100" in the second formula converts from a proportion to a percentage. Personally, I prefer to compute the proportion and then use the PERCENT8.2 format to display the proportion as a percentage.