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

Showing results for

- Home
- /
- Programming
- /
- SAS Procedures
- /
- PROC PLM SCORE without some parameters

- 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 02-07-2019 02:37 PM
(1076 views)

Is there a way to score data based on a store from a previously executed model but exclude some parameters. For example, let's say my model is

`model y = x1 + x2 + x3 + x4;`

When I store the parameters and score a new dataset based on this store, Y would be calculated as the sum of an intercept and X1 through X4. I only want to score using intercept and X1 through X3--I want to skip X4.

Thanks,

Haris

1 ACCEPTED SOLUTION

Accepted Solutions

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

Use the code statement to generate scoring code and modify the code to exclude X4.

12 REPLIES 12

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

Can you use a value of zero for x4?

--

Paige Miller

Paige Miller

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

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

Well, then, mark me down as confused.

I don't understand this restriction

Renaming X4 to X4_1 and setting X4 to zero would do exactly what I need. I am looking for an option to drop X4 from scoring without manipulating the original data.

You don't have to destroy the original data set. You can copy it and rename X4 and the original data set remains unchanged.

--

Paige Miller

Paige Miller

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

Yes, you are correct: I can manipulate the dataset to achieve what I need. I am lazy! I am hoping there is an option that goes along wtih PROC PLM SCORE statement, something like 'SKIP X4' or 'SET X4=0' that SCORES without using the X4. Do you think that's too much to ask?

Alternatively, is there a way to edit the STORE and change the parameter for X4 to zero? Store files are small and I would have no problem creating copies of the STORE. My datasets are massive in size.

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

You don't have to actually create a new dataset. You can define a view that will filter your data only when it is accessed by PLM.

PG

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

Another good alternative, PGStats, but it is still focused on manipulating the original data--non-destructively, in your case.

But, is it the case that there is no option in PROC PLM to skip or change parameters in the STORE when scoring?

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

Use the code statement to generate scoring code and modify the code to exclude X4.

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

Thanks. A bit messy and manual but gets the job done without the need to alter the master dataset.

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

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

Thanks, Rick. I am not exactly clear what you mean by:

Setting x4=0 in the scoring data is a valid operation

Can I do this when scoring or is this something I could do when creating the STORE?

With respect to 'does not make statistical sense', I am trying to do something similar to estimating BLUP vs NOBLUP predicted values just with fixed rather than random effects. X4 is an effect of a geographical region. But statistical the validity of dropping fixed parameters during scoring operation is a whole different topic. I am only interested in the capabilities of PROC PLM at this point.

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

Setting x4=0 was @PaigeMiller 's original suggestion. You do it by using a DATA step view, as @PGStats suggested.

Since you mentioned mixed models and EBLUPs, I will mention that the SCORE statement in PROC PLM produces that same scores as the OUTPM= data set in PROC MIXED. That is, the predicted values do not incorporate the EBLUP values. The predicted values are simply X*beta_hat. Thus if x4 is a **random** effect, I think the SCORE statement does what you want.

If x4 is a **fixed** effect in your model, I do not believe there is a way to force the SCORE statement to exclude the x4 effect.

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

Thanks @Rick_SAS.

My X4 is a FIXED effect so it seems like I will need to find a way to exclude it from the score outside of the native PROC PLM functionality.

And since you mentioned it, the ability to score RANDOM as well as FIXED effects in PROC PLM would be very helpful in my work. Right now the only way I know how to work out combinations of FIXED and RANDOM effects in mixed models where linear formulas for variance don't exist is the ESTIMATE statement in GLIMMIX. Given how long some of the models take to estimate, the lack of ability to calculate inferential tests for combinations of FIXED and RANDOM effects in PROC PLM is limiting.

I hope I am wrong and there is a way to do that that I am not aware off.

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

**If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. **

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.