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
- /
- help using TEST in MIANALYZE

Topic Options

- 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
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-17-2017 01:48 PM

I am using PROC MIANALYZE after PROC MIXED.

In trying to run a post-estimation test comparing two linear combinations of variables, using the TEST statement in PROC MIANALYZE, I am having trouble with what I am trying to do, so I am hoping someone can tell me if it is possible.

This is an example of what I'm trying to do:

example1: test intercept + (b1*SOMECONSTANT) = intercept + (b1*SOMECONSTANT) + b2

In words, I have a value that I would like to plug into the linear equation to compare these two models to each other. Essentially, this is comparing two predicted values to each other.

I know that I can run the test this way (because I have run this and it works):

example2: test intercept + b1= intercept + b1+ b2

But, is there any way to multiply those coefficients (ex. b1) by a number? Or, conversely, is my 2nd example a satisfactory test?

Thank you for any advice!

Erin

Accepted Solutions

Solution

01-30-2017
09:59 AM

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

Posted in reply to ErinB

01-26-2017 01:07 PM

Steve (and any others looking for an answer to this question) --

I figured it out!

You CAN include multipliers in the test statement, you just have to enter them in a specific way...

For example, if this is what you are testing:

3*(x1 + x2) + 9*(x3 + x4) = 0

You have to type the code this way:

test 3*x1 +3*x2 + 9*x3 + 9*x4=0

In other words, factor it out.

Thanks for all of your help and feedback!

All Replies

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

Posted in reply to ErinB

01-19-2017 03:28 PM

I might be missing something obvious here, but why not use TEST b2=0, which comes out with a bit of algebra ? I would think this would be valid for all values of SOMECONSTANT.

If I am missing the obvious, please post back.

Steve Denham

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

Posted in reply to SteveDenham

01-23-2017 02:58 PM

Steve,

Thanks for the reply.

I should've used my more complicated example, because what you're saying is accurate. They would cancel out.

I'll use a few actual numbers here.

I have 2 long linear combinations of numbers that I can get down to this formula:

9* (x1) + 3*( x4 ) = 0

The reason why the 9 and the 3 are important is that they are indicators of time (months), so if I omit those constants, I am allowing x1, for example, to have the same "effect" as x4, for example. x1 and x4 in this example are each something that reflects a 1 month change. So in order to talk about the estimated effect of that 9 month time period, I need to multiply x1 by 9. Similarly in order to talk about the estimated effect of the entire 3 month time period, I need to multiply the x4 by 3.

I'm trying to use this test to compare the actual predicted values I calculated.

Thanks in advance for any suggestions or comments if I'm thinking about this in the wrong way!

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

Posted in reply to ErinB

01-25-2017 08:11 AM

I would have to noodle this around some to see if it would even work, but what about preprocessing the output dataset from PROC MI to get a new variable that has the effect of getting the response down to what you are interested in, and then applying MIANALYZE to that? It's the only thing I can think of currently.

Steve Denham

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

Posted in reply to SteveDenham

01-25-2017 11:59 AM

Thanks for responding, Steve. I'm not quite sure what you're thinking here.

I'm using **PROC MIXED** for my analysis, so what are you thinking about what I could do in that step that would allow me to multiply variables and numbers together in the test statement for MIANALYZE?

I had one other alternative idea -- but I'm not sure how this would work either.

What if I just ran PROC MIXED on a single imputed data set (really, do it separately for each of my 10 data sets), and then ran some sort of post-estimation test after that? Not even worrying about the MIANALYZE step. Would there be a way to do my hypothesis tests that way? Would I have to get creative with the ESTIMATE command? I haven't used it before, so I'm not sure that could even allow for the multiplication by my 3 and 9.

Solution

01-30-2017
09:59 AM

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

Posted in reply to ErinB

01-26-2017 01:07 PM

Steve (and any others looking for an answer to this question) --

I figured it out!

You CAN include multipliers in the test statement, you just have to enter them in a specific way...

For example, if this is what you are testing:

3*(x1 + x2) + 9*(x3 + x4) = 0

You have to type the code this way:

test 3*x1 +3*x2 + 9*x3 + 9*x4=0

In other words, factor it out.

Thanks for all of your help and feedback!

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

Posted in reply to ErinB

01-30-2017 09:48 AM

Mark your answer as correct!

Thanks for working this out, Erin. It will be useful to many, including me.

Steve Denham