BookmarkSubscribeRSS Feed
alexPrice
Calcite | Level 5

I keep getting a no valid observations error.  My code works when I only have 2 variables but anymore than that and SAS doesn't know what to do.  What am I doing wrong?

 

data totalHeight;
input FFD SPR RGF PLF SLF;
datalines;
82 1.468 3.30 0.166 0.10
89 1.605 3.64 0.154 0.10
101 2.168 4.87 0.177 2.90
107 2.054 4.72 0.275 1.10
115 2.467 4.11 0.298 1.00
122 1.294 3.75 0.150 0.90
127 2.183 3.97 0.000 2.40
137 2.426 4.65 0.117 1.80
147 2.607 3.84 0.155 2.30
166 4.567 4.92 0.138 3.20
174 4.588 3.82 0.249 3.50
175 3.618 4.32 0.143 2.80
177 5.855 4.53 0.172 2.50
184 2.898 4.48 0.178 3.00
187 3.880 5.39 0.101 3.00
189 0.455 4.99 0.008 2.64
194 8.088 4.50 0.251 2.70
197 6.502 5.20 0.366 2.90
201 6.081 5.65 0.106 2.90
204 7.105 5.40 0.089 3.20
255 8.548 4.20 0.222 2.90
328 6.321 6.45 0.187 2.00
;
proc reg data=totalHeight;
model FFD=SPR RGF PLF SLF/selection=stepwise;
run;

4 REPLIES 4
Reeza
Super User

Works fine for me. Post your exact code and log. 

 

 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 68         
 69         data totalHeight;
 70         input FFD SPR RGF PLF SLF;
 71         datalines;
 
 NOTE: The data set WORK.TOTALHEIGHT has 22 observations and 5 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       cpu time            0.01 seconds
       
 
 94         ;
 95         proc reg data=totalHeight;
 96         model FFD=SPR RGF PLF SLF/selection=stepwise;
 97         run;
 
 98         
 99         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 110   
Spoiler

@alexPrice wrote:

I keep getting a no valid observations error.  My code works when I only have 2 variables but anymore than that and SAS doesn't know what to do.  What am I doing wrong?

 

data totalHeight;
input FFD SPR RGF PLF SLF;
datalines;
82 1.468 3.30 0.166 0.10
89 1.605 3.64 0.154 0.10
101 2.168 4.87 0.177 2.90
107 2.054 4.72 0.275 1.10
115 2.467 4.11 0.298 1.00
122 1.294 3.75 0.150 0.90
127 2.183 3.97 0.000 2.40
137 2.426 4.65 0.117 1.80
147 2.607 3.84 0.155 2.30
166 4.567 4.92 0.138 3.20
174 4.588 3.82 0.249 3.50
175 3.618 4.32 0.143 2.80
177 5.855 4.53 0.172 2.50
184 2.898 4.48 0.178 3.00
187 3.880 5.39 0.101 3.00
189 0.455 4.99 0.008 2.64
194 8.088 4.50 0.251 2.70
197 6.502 5.20 0.366 2.90
201 6.081 5.65 0.106 2.90
204 7.105 5.40 0.089 3.20
255 8.548 4.20 0.222 2.90
328 6.321 6.45 0.187 2.00
;
proc reg data=totalHeight;
model FFD=SPR RGF PLF SLF/selection=stepwise;
run;


ChrisNZ
Tourmaline | Level 20

Your code generates no error for me.

alexPrice
Calcite | Level 5

I copied the code from my post and put it back into my SAS and it works now, I am not sure why but that is super annoying, I spent about an hour trying to figure out why it wouldn't work.  O well.  

mkeintz
PROC Star

Even though no error was found in your program, please mark your topic as solved.  I'd recommend marking your own response reporting that resubmission ran successfully as the "solution".

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------

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
  • 4 replies
  • 767 views
  • 0 likes
  • 4 in conversation