03-17-2014 12:41 PM
Suppose i want to subtract the mean of sbp in StdTyp 1 Period 1 Trtgrp 1 (highlighted) from the mean of StdTyp 1 Period 1 Trtgrp 2 (highlighted) to give a variable called X, what code do i use? I have pasted the output below. thanks. Tried different things but didnt work.
The MEANS Procedure
StdTyp Period Trtgrp N obs variable N mean Std Dev Minimum Maximum
03-19-2014 10:59 AM
Based on the data set name and variables names I think perhaps you should ask about this as a statistical analysis question not just as a data summary. Perhaps could look at your data give some advice.
However I will show you how you can use PROC ANOVA to compute the means differences as per your example. Using PROC ANOVA allows you do get the differences directly without having to do much in the way of data manipulation.
03-19-2014 01:49 PM
Follow the advice of data_null_; This will give you the differences in the raw means you are looking for.
Then start thinking about things like cross-over designs, repeated measures on subjects, unbalancedness, and the fact that sbp (systolic blood pressure?) and dbp (diastolic blood pressure) are surely correlated within subject as well. A full description of the experimental design would lead to a more comprehensive analysis.
My biggest problem with unbalanced designs is that the difference between raw means is a biased estimator of effects.
03-20-2014 08:16 AM
Then the raw means are relatively meaningless. Google is your friend--there are multiple examples out there of the analysis of cross-over designs using PROC GLM, PROC MIXED and PROC GLIMMIX. The lsmeans generated from these analyses accommodate the multiple effects, and the imbalance seen. I would really suggest going that way with this data.