Programming the statistical procedures from SAS

CONTRAST statement in proc NLMIXED

Accepted Solution Solved
Reply
Contributor
Posts: 65
Accepted Solution

CONTRAST statement in proc NLMIXED

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


Accepted Solutions
Solution
‎09-10-2012 02:02 PM
Valued Guide
Valued Guide
Posts: 679

Re: CONTRAST statement in proc NLMIXED

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.

View solution in original post


All Replies
Solution
‎09-10-2012 02:02 PM
Valued Guide
Valued Guide
Posts: 679

Re: CONTRAST statement in proc NLMIXED

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.

Contributor
Posts: 65

Re: CONTRAST statement in proc NLMIXED

Thanks so much Ivy!  It is really helpful and constructive note.

Issac

Contributor
Posts: 65

Re: CONTRAST statement in proc NLMIXED

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.18040.33132443-3.560.00040.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 

Respected Advisor
Posts: 2,655

Re: CONTRAST statement in proc NLMIXED

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

Contributor
Posts: 65

Re: CONTRAST statement in proc NLMIXED

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

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 486 views
  • 3 likes
  • 3 in conversation