DATA Step, Macro, Functions and more

Sas regression

Reply
New Contributor
Posts: 2

Sas regression

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;

Super User
Posts: 23,228

Re: Sas regression

Posted in reply to alexPrice

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;


PROC Star
Posts: 2,307

Re: Sas regression

Posted in reply to alexPrice

Your code generates no error for me.

New Contributor
Posts: 2

Re: Sas regression

Posted in reply to alexPrice

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.  

Trusted Advisor
Posts: 1,309

Re: Sas regression

Posted in reply to alexPrice

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".

Ask a Question
Discussion stats
  • 4 replies
  • 108 views
  • 0 likes
  • 4 in conversation