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

Hello . Thank you for your time. 

 

 I have some terrible question. 

 

   I have to clear the observation that out of (-2,2) rstudent . 

캡처.JPG

 

 

Does anybody know how to delete those observation out of (-2,2) ,by coding ? there are too many to find and delete manually...

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

Use OUTPUT statement to save rstudent:

proc reg data=sashelp.class;
model weight=age height;
output out=want rstudent=rstudent cookd=cookd;
quit;

and proc sort it ,delete obs you don't want.

 

View solution in original post

4 REPLIES 4
ballardw
Super User

From you graph it appears that you may have a variable rstudent with values of concern. If that is the case then what you want is fairly simple:

 

Data want;

    set have;

    where -2 le rstudent le 2;

run;

 

 

LeeSeongWoo_
Fluorite | Level 6

Thank you for your reply . but This graph is part of the proc reg result . 

 

for example :

 

  proc reg data = work.aa; 

  model y=x1 x2 x3; 

 run; 

 

so i don't have rstudent variable . 

what i want to know is how can i make these variable ?

 

Thank you for reading 

Ksharp
Super User

Use OUTPUT statement to save rstudent:

proc reg data=sashelp.class;
model weight=age height;
output out=want rstudent=rstudent cookd=cookd;
quit;

and proc sort it ,delete obs you don't want.

 

ballardw
Super User

You can use dataset options on output data sets in procedures that create data sets directly:

proc reg data=sashelp.class;
model weight=age height;
output out=want (where=( 2 le rstudent le 2))
      rstudent=rstudent cookd=cookd;
quit;

sas-innovate-2024.png

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.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1666 views
  • 1 like
  • 3 in conversation