BookmarkSubscribeRSS Feed
Miah
Obsidian | Level 7

I am learning about SAS programming. I am trying to create a normal probability plot under the PROC REG statement. Attached it is my data set. This is my model/code: 

 

DATA census;
INFILE "/folders/myfolders/census.txt"
DLM=',' FIRSTOBS=2 DSD MISSOVER;
INPUT ClassGrade Ageyears Height_cm Footlength_cm Armspan_cm SchoolSleep NonSchoolSleep TextSent TextReceived;
RUN;

PROC PRINT DATA= census;
RUN;

PROC REG DATA=census;
MODEL TextSent = TextReceived;
RUN;

ODS GRAPHICS ON;

PROC REG DATA=census
PLOTS TextSent*TextReceived npp.*r.;
MODEL TextSent = TextReceived;
title 'Normal Probability Plot On The Residuals';
RUN;

 

But my code is not working. How can I possibly generate my desired plot? Normal Probability Plot on the residuals?

2 REPLIES 2
Reeza
Super User

 

The PLOTS syntax you're using is no longer supported in PROC REG, but you should look at the default plots and see if that meets your need. 

 

proc reg data=sashelp.class plots;
model weight = height age;
run;

If this doesn't meet your needs, you can use an OUTPUT statement to capture the residuals and use PROC UNIVARIATE or SGPLOT to create the plot 'manually'. 

 

PS. Please include a clear description of what "doesn't work" means. That could mean anything from your computer literally being on fire to a simple syntax error message. Include the log at minimum.

PGStats
Opal | Level 21

The normal quantile plot might be enough?

 


PROC REG DATA=census plots(only)=qq; 
MODEL TextSent = TextReceived;
RUN;
PG

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!

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
  • 2 replies
  • 5403 views
  • 2 likes
  • 3 in conversation