turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- Problems writing an ESTIMATE statement

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-16-2012 09:53 AM

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;

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-19-2012 07:56 AM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-19-2012 10:36 AM

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?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-20-2012 07:22 AM

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