Programming the statistical procedures from SAS

Calculate standard deviations by proc mixed!!

Reply
Frequent Contributor
Posts: 81

Calculate standard deviations by proc mixed!!

Dear all,

Is there a way to obtain standard deviation (SD) by proc mixed, for each lsmean values instead (or plus) of standard error (SE)?


proc mixed data=have method=REML;

      class id year province y;

      model y = year province;

      random id;

      lsmeans year;

   run;

Thanks in advance

zana

Frequent Contributor
Posts: 81

Re: Calculate standard deviations by proc mixed!!

Sorry, i had a mistake in my model.

The true model equation is;

proc mixed data=have method=REML;

      class id year province;

      model y = year province;

      random id;

      lsmeans year;

   run;

Regards

zana

Respected Advisor
Posts: 2,655

Re: Calculate standard deviations by proc mixed!!

The standard error reported is the standard deviation of the population of means, conditional on the random effects and marginal over differences in sample size.  Additionally, under the model presented, you assume homogeneity of variances by year and province, so that standard errors of each year will be identical, as will the standard errors of each province (assuming a balanced design)..

I suppose it could be done by multiplying the standard error by sqrt(df + 1), but I am curious as to why you would do this.  The value obtained has little to do with anything related to the sample or what might be considered the originating population.  Why not just use the sample standard deviation reported by PROC MEANS?

In the end, do you want heterogeneous estimates of variability?  That would involve use of the repeated statement--see Example 63.7 of The MIXED Procedure.

New Contributor P20
New Contributor
Posts: 2

Re: Calculate standard deviations by proc mixed!!

Hi Steve

Could you please explain this statement:

" The value obtained has little to do with anything related to the sample or what might be considered the originating population. "

Why wouldn't the SD have anything to do with the originating population. Wouldn't a person want to know the estimated mean and estimated SD to calculate estimated Cohen's Ds?

All the best.

 

Respected Advisor
Posts: 2,655

Re: Calculate standard deviations by proc mixed!!

Ah.  Cohen's D.

 

Try looking at:

 

http://www.psy.mq.edu.au/psystat/documents/standardised_effect_size_in_mixed_ML_models.pdf

 

Also read Jake Westfall's blog on the subject:

 

http://jakewestfall.org/blog/index.php/2016/03/25/five-different-cohens-d-statistics-for-within-subj...

 

It comes down to the notion that in mixed models, there is more than one source of variability, and a composite standard deviation is needed if you really want to calculate a standardized effect size.

 

Steve Denham

Ask a Question
Discussion stats
  • 4 replies
  • 2212 views
  • 2 likes
  • 3 in conversation