DATA Step, Macro, Functions and more

Can SAS do exclude/hide like JMP

Accepted Solution Solved
Reply
Contributor
Posts: 39
Accepted Solution

Can SAS do exclude/hide like JMP

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!


Accepted Solutions
Solution
2 weeks ago
Respected Advisor
Posts: 3,249

Re: Can SAS do exclude/hide like JMP

Posted in reply to leonzheng

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


All Replies
Respected Advisor
Posts: 3,249

Re: Can SAS do exclude/hide like JMP

Posted in reply to leonzheng

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
Contributor
Posts: 39

Re: Can SAS do exclude/hide like JMP

Posted in reply to PaigeMiller
if I use WHERE and do the fit, will SAS calculate residual for me on those excluded points?
Solution
2 weeks ago
Respected Advisor
Posts: 3,249

Re: Can SAS do exclude/hide like JMP

Posted in reply to leonzheng

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
Contributor
Posts: 39

Re: Can SAS do exclude/hide like JMP

Posted in reply to PaigeMiller
thx, let me try
☑ This topic is solved.

Need further help from the community? Please ask a new question.

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