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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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