Hi everyone;
I am working with 9.3 version. My model did work and now want to do some tests for its estimates. The following is the code
proc nlmixed data=x EBOPT MAXFU=800 maxit=600 ;
where id ~=. ;
lambda=exp(b0+badmsource*admsourceHOSPITAL+bseqadmsource*admsourceHOSPITALseq+bseqsloglos*seqsloglos+b1maruser*marMARRIEDuserenrolleeYES+b2maruser*marPREVIOUSLY_MARRIEDuserenrolle
+b1marseq*marMARRIEDseq+b2marseq*marPREVIOUSLY_MARRIEDseq+bsloglos*sloglos+e);
ll=-lambda*nrtime/***(alpha+1)*/+rstatus*(/*LOG(alpha+1)+alpha*LOG(nrtime)+*/LOG(lambda));
MODEL nrtime~GENERAL(ll);
RANDOM e~NORMAL(0,sd*sd) SUBJECT=id;
PARMS b0=0 badmsource=0 bseqadmsource=0 bseqsloglos=0 b1maruser=0 b2maruser=0 b1marseq=0 b2marseq=0 bsloglos=0
sd=1 /*alpha=0*/;
CONTRAST 'maruser' mar*userenrollee 1 -1 ;
run;
I want to test that "b1maruser=b2maruser" or not, but I cannot process it in CONTRAST. These tow estimates are related to crossed effect "mar*userenrollee" that I previously built by output design matrix from proc logistic.
The error is this:
88 CONTRAST 'maruser' mar*userenrollee 1 -1 ;
-
22
76
ERROR 22-322: Syntax error, expecting one of the following: (, *, **, +, ',', -, /, <>, ><, [, {.
ERROR 76-322: Syntax error, statement will be ignored.
Any helpful comments would be highly grateful.
Thanks!
Issac
You are trying to use the syntax of MIXED or GLIMMIX (etc.) with NLMIXED. They are not the same. In NLMIXED, there are no "levels" of a factor, because factors are not used (explicitly). If you just want to know if b1maruser is different from b2maruser (both parameters in your model), then I suggest:
ESTIMATE 'label' b1maruser - b2maruser;
A slightly harder way, but explicitly using +1 and -1, would be:
ESTIMATE 'label' 1*b1maruser -1*b2maruser;
In NLMIXED, you use ESTIMATE for linear or nonlinear functions of parameters (no variables listed). The CONTRAST statement is primarily to have multiple ESTIMATEs in the same statement.
You are trying to use the syntax of MIXED or GLIMMIX (etc.) with NLMIXED. They are not the same. In NLMIXED, there are no "levels" of a factor, because factors are not used (explicitly). If you just want to know if b1maruser is different from b2maruser (both parameters in your model), then I suggest:
ESTIMATE 'label' b1maruser - b2maruser;
A slightly harder way, but explicitly using +1 and -1, would be:
ESTIMATE 'label' 1*b1maruser -1*b2maruser;
In NLMIXED, you use ESTIMATE for linear or nonlinear functions of parameters (no variables listed). The CONTRAST statement is primarily to have multiple ESTIMATEs in the same statement.
Thanks so much Ivy! It is really helpful and constructive note.
Issac
Ivy!
What if I want to test that both whether b1maruser and b2maruser are set equal to zero or not? Because when I did what you recommend, it gives
Label Est. StError DF t Value Pr. Alpha Lower Upper
label | -1.1804 | 0.3313 | 2443 | -3.56 | 0.0004 | 0.05 | -1.8300 | -0.5307 |
---|
means b1maruser could not be the same as b2maruser, but it does not test whether both could be zero or not?
Really appreciate!
Issac
Hi Issac,
Check your parameter estimates table. It should have a t-test (based on the delta method to estimate the standard error) for every parameter, testing the null hypotheis Ho: Parameter=0.
If you want a joint test that the two parameters are simultaneously zero, then a contrast statement such as:
contrast 'Simultaneous test' b1manuser, b2manuser;
ought to give a 2 df test. Note the comma between the two SAS expressions.
Steve Denham
Morning Steve;
Exactly what I was looking for. The 2 df are related to the Numerator and for Denominator, it used the same DF as provided in the last parameter estimate table.
Thanks so much!
Issac
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.