BookmarkSubscribeRSS Feed
Clemence
Calcite | Level 5

Hello,

 

I use PROC NLMIXED to estimate a mean. And I wish to compare the result at the PROC MEANS.

 

My code is :

 

proc nlmixed data=lbmain_inclus_final;
parms sigsq0=0.2 sigsqe=0.3 beta0=0.3851 beta1=0.1433 beta2=0.5633 beta3=0.01331 beta4=0.01 beta5=0.02 ;
bounds sigsq0 sigsqe >= 0;

pi=2*arsin(1);

mu=beta0+beta1*produit+beta2*visite1+beta3*visite2+beta4*produit*visite1+beta5*produit*visite2+ a_i;

ll=(1/(sqrt(2*pi*sigsqe)))*exp(-(LB_qSTAanum_LOG_cop_cm-mu)**2/(2*sigsqe));

L=log(ll);

model LB_qSTAanum_LOG_cop_cm ~ general(L);
random a_i ~ normal(0,sigsq0) subject=SUBJID;

 

/**Estimates**/

moy_v1_prod=beta0+beta1+beta2+beta4;
estimate "moy_v1 produit" moy_v1_prod;

 

run;

 

With this code, I obtain the same mean that PROC MEANS but how obtain the standard deviation ? Because proc nlmixed give the standard error but when I calculate : sqrt(n)*standard_error, I don't obtain the same standard deviation that proc means. Is it normal ? Or, how obtain the good standard deviation with proc nlmixed ?

 

Thanks for your answer.

Clémence

 

2 REPLIES 2
Rick_SAS
SAS Super FREQ

The mean of what? Please show your PROC MEANS code.

 

The NLMIXED code is computing the MLE of regression coefficients for a regression of  LB_qSTAanum_LOG_cop_cm onto main and interaction effects of produit and visite1 and visite2. You cannot duplicate that analysis by using PROC MEANS, which is a univariate analysis. You can try to use PROC GLM with a MODEL statement

 

proc glm data=lbmain_inclus_final;

MODEL LB_qSTAanum_LOG_cop_cm  = produit visite1 visite2 produit*visite1 produit*visite2;

/* optionally include an ESTIMATE statement */

run;

Clemence
Calcite | Level 5

My code is :

 

proc means data=lbmain_inclus_final;
var LB_qSTAanum_LOG_cop_cm;
by prdt tv_visit;
run;

 

I thought I could find the same results with proc nlmixed but yes, you are right , with proc nlmixed it's a multivariable analysis.

 

Thanks

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 695 views
  • 0 likes
  • 2 in conversation