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!
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.
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.
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.
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 25. Read more here about why you should contribute and what is in it for you!
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.