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;
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
@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;
Your code generates no error for me.
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.
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".
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.