Suppose we have 20 subjects, and for each subject we have four variables: X1, X2, X3, and X4. I want to calculate the average for each subject, but the problem is whenever there is a missing value(s), SAS won't give the mean value. How can I do that while adjusting for n (if no missing value, n=4, if there is one missing values, then n=3, etc.) Thanks.
Use the mean
function:
average = mean(x1,x2,x3,x4);
or
average = mean(of x1-x4);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With