SAS Programming

DATA Step, Macro, Functions and more
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-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 6412 views
  • 2 likes
  • 3 in conversation