BookmarkSubscribeRSS Feed
FraukevdRijt
Calcite | Level 5

Dear, 

 

I need to work with PISA data. This is a large data set with a lot of observations and variables. 

I want to delete observations (rows) with missing values, by using listwise deletion. 

I tried to use proc corr data = pisastu2015vla nomiss; 

 

But when I do this I get an ERROR: The NOMISS option is specified, but all variables have at least one missing value for all
observations in the input data set. I don't understand how this is possible. Because my teacher told me to use listwise deletion and delete rows with missing variables. 

sdse.PNG

 

Can somebody help me? 

3 REPLIES 3
ballardw
Super User

@FraukevdRijt wrote:

Dear, 

 

I need to work with PISA data. This is a large data set with a lot of observations and variables. 

I want to delete observations (rows) with missing values, by using listwise deletion. 

I tried to use proc corr data = pisastu2015vla nomiss; 

 

But when I do this I get an ERROR: The NOMISS option is specified, but all variables have at least one missing value for all
observations in the input data set. I don't understand how this is possible. Because my teacher told me to use listwise deletion and delete rows with missing variables. 

 

 

Can somebody help me? 


So where did you delete the observations? Show the code you used to delete the observations.

 

When you use the option NOMISS on the Proc Corr statement that says you are excluding any observation with any missing analysis variables. Since you did not list any variables on a VAR statement then all numeric variables were treated as analysis variables.

 

I think you should describe what you intend by 'listwise deletion'.

 

Typically delete means to remove from a data set such as with pseudo code:

data new;
   set old;
   if <some condition is met> then delete.
run;

and then use the NEW data set.

 

If your interest is to run proc corr then do not use the NOMISS option (at least with this data set) OR use data set options and/or where statement to restrict analysis to records where specific variables are not missing.

 

BTW instead of taking the time to make an image of your log or editor you can copy directly from the LOG or the Editor and paste into a code box opened using either the {I} or "running man" icon found in forum's message window menu.

 

That way we copy and modify text to indicate corrections or highlight items to discuss. Or even run data steps using inline data to create data sets to manipulate.

PGStats
Opal | Level 21

Try

data test;
set pisastu2015vla;
if not cmiss(_numeric_);
run;

and see what comes out.

PG
ballardw
Super User

@PGStats wrote:

Try

data test;
set pisastu2015vla;
if not cmiss(_numeric_);
run;

and see what comes out.


I think a missing "OF" in the cmiss call is needed.

From the introduction to the question we have something like:

data junk;
   input x y z;
datalines;
. 2 3
1 . 3
1 2 .
;
run;

data test;
set junk;
if not cmiss(of _numeric_);
run;

which yields:

NOTE: There were 3 observations read from the data set USER.JUNK.
NOTE: The data set USER.TEST has 0 observations and 3 variables.

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