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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.