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

Showing results for

- Home
- /
- Programming
- /
- SAS Procedures
- /
- Re: help using TEST in MIANALYZE

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

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 01-17-2017 01:48 PM
(1483 views)

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

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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!

6 REPLIES 6

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Mark your answer as correct!

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

Steve Denham

**SAS Innovate 2025** is scheduled for May 6-9 in Orlando, FL. Sign up to be **first to learn** about the agenda and registration!

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.

Ready to level-up your skills? Choose your own adventure.