BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
leonzheng
Obsidian | Level 7

I have to operate a DateSet like below:

Fit a 4th polynomial on some observations that satisfy conditions. Then I need to calculate residual for all observations, including the observations not satisfy conditions. In JMP I can exclude/high those obs, but in SAS I don't know how to do it, I can only delete obs and create a new table, but then the deleted obs will not have residual.

Can anyone give me advice on this?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

Not directly, but you can either trick SAS to do this by making the real Y variable missing to get a predicted value, or use PROC SCORE on the excluded points to generate predicted values and residuals.

--
Paige Miller

View solution in original post

4 REPLIES 4
PaigeMiller
Diamond | Level 26

Exclude means that the observation is not used in the calculation of the model fit, so you will not get a residual value for it. Yes, SAS can do this. Simply don't include the variable in the procedure that fits the plot (you can use the WHERE data set option to exclude specific rows from a data set).

 

Hide means that a data point is not shown on a plot. Yes, SAS can do this. When you produce the plot, use the WHERE option to not include the observations.

--
Paige Miller
leonzheng
Obsidian | Level 7
if I use WHERE and do the fit, will SAS calculate residual for me on those excluded points?
PaigeMiller
Diamond | Level 26

Not directly, but you can either trick SAS to do this by making the real Y variable missing to get a predicted value, or use PROC SCORE on the excluded points to generate predicted values and residuals.

--
Paige Miller
leonzheng
Obsidian | Level 7
thx, let me try

SAS Innovate 2025: Save the Date

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

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 4 replies
  • 1080 views
  • 0 likes
  • 2 in conversation