BookmarkSubscribeRSS Feed
chuakp
Obsidian | Level 7

I'm using PROC SURVEYREG and am trying to figure out how to write an ESTIMATE statement to set up a hypothesis test that beta7+beta8+beta9 = 0.  Beta7 is the term DROPOUTOFSCHOOL*YEAR2 (continous by dichotomous), Beta8 is MOVE*YEAR2 (dichotomous by dichotomous), Beta9 is DROPOUTOFSCHOOL*MOVE*YEAR2 (continuous by dichotomous by dichotomous).  [The full code is at the bottom of this post].

I've been able to write an ESTIMATE statement for a bunch of hypothesis tests that are close to what I want (note here BETA1 is the coefficient for the term YEAR2, if you're curious). 

/*This is B7+B9*/

estimate 'Beta7+Beta9' dropoutofschool*year2 1 -1 dropoutofschool*move*year2 1 -1 0 0  /e;

estimate 'Beta1+Beta8' year2 1 -1 move*year2 1 -1 0 0 /e;

estimate 'Beta1+Beta7+Beta8+Beta9' dropoutofschool*year2 1 -1 dropoutofschool*move*year2 1 -1 0 0 year2 1 -1 move*year2 1 -1 0 0 /e;

I would think the estimate statement for the hypothesis that beta7+beta8+beta9 = 0 would look like this:

estimate 'Beta7+Beta8+Beta9' dropoutofschool*year2 1 -1 dropoutofschool*move*year2 1 -1 0 0 move*year2 1 -1 0 0 /e;

...but SAS says this is not estimable.  What am I doing wrong here?  Thanks - I've spent the better part of half a day on this.

proc surveyreg data = asthmatics_1619;

weight longwt;

strata varstr;

cluster varpsu;

class move year2 sex race regiony1 msay1 panel;

model haveusc = dropoutofschool lossofinsurance move year2 dropoutofschool * move

lossofinsurance * year2 dropoutofschool * year2 move * year2 dropoutofschool * move * year2

agebeginning_years sex race regiony1 msay1 panel /solution;

format move movefmt. year2 yearfmt. sex sex. race racethnx. regiony1 regin08f. msay1 msa08f.;

estimate 'Beta7+Beta8+Beta9' dropoutofschool*year2 1 -1 dropoutofschool*move*year2 1 -1 0 0 move*year2 1 -1 0 0 /e;

run;

3 REPLIES 3
SteveDenham
Jade | Level 19

For the continuous variable dropoutofschool, you need to provide some value at which you wish to estimate the function.  A good starting point would be to add

lsmeans dropoutofschool*year2 move*year2 dropoutofschool*move*year2/e;

The 'e' option will print the L matrix associated with each of the least squares means, including the slope coefficient for dropoutofschool.  From this, the estimates can be correctly constructed.

Good luck.

Steve Denham

chuakp
Obsidian | Level 7

Thanks, Steve.  Unfortunately, lsmeans is not supported by SURVEYREG in my version of SAS (9.2).  I believe I want to evaluate the effect of dropoutofschool at the value of 1.  What would be the syntax for this? 

SteveDenham
Jade | Level 19

I'm horrible at this--that's why I always use the /e terminology to write estimates.  I would also take a look at SAS System for Mixed Models by Littell et al. in the section on analysis of covariance.  George Milliken has a TON of examples using ESTIMATE statements in there.

Here would be my workaround--shift to PROC GLM or MIXED, which do support the LSMeans statement, and use the /e option there.  From those L matrix printouts, work out the code for the estimates, then drop those back into SURVEYREG.

Also, my version of 9.2 (9.22 for the documentation, 9.2 (TS2M3)) does support LSMEANS.  This is a simple upgrade/hotfix and may be well worth your time.  Besides the LSMEANS statement, you will have access to the LSMESTIMATE statement, which may be of use in this project.

Good luck.

Steve Denham

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 754 views
  • 0 likes
  • 2 in conversation