I am trying to use PROC PANEL for an unbalance data set. after receiving this error:
ERROR: There is only one cross section or time series observation. Computations will be
terminated.
I did what is suggested here http://support.sas.com/kb/22/850.html to check my data set.
this is what I did
data x;
set panelanalysis;
x=tcIHUB +LABvalue + RADIOvalue + TRANSvalue;
run;
proc print data=x (obs=10);
var tcIHUB LABvalue RADIOvalue TRANSvalue x;
run;
Obs | tcIHUB | LABvalue | RADIOvalue | TRANSvalue | x |
1 | 0 | 0 | 1 | 0 | 0 |
---|---|---|---|---|---|
2 | 0 | 0 | 2 | 0 | 0 |
3 | 0 | 1 | 0 | 0 | 0 |
4 | 0 | 1 | 0 | 0 | 0 |
5 | 0 | 1 | 0 | 0 | 0 |
6 | 0 | 1 | 0 | 0 | 0 |
7 | 0 | 3 | 0 | 0 | 0 |
8 | 0 | 1 | 0 | 0 | 0 |
9 | 0 | 8 | 1 | 0 | 0 |
10 | 0 | 9 | 9 | 1 | 0 |
Strangely, I see that SAS does not do the summation correctly.all of the values of varia there is no error or warning about data type or anything else in the log.
I suspect that the same reason that makes the summation results to be incorect is casuing the error in PROC PANEL.
Any idea is greatly appreciated!
The problem solved. it was due to OPTIONS SETMISS=0;
interestingly, if you have this option in SAS 9.3, the missing values in will be displayed as zeros but actually remain missing i the background and thus if you add them to another nonmissing variable the result will be missing, but shown as zeros in the output.
there is no error or warning in log. I think SAS should consider this in their hotfixes or next versions
This is just a guess, triggered by how the values for your four variables lined up in the print output. Is it at all possible that these four variables are somehow character variables?
Steve Denham
Steve; No they are all numeric variables.
But the point is that the very first data set, was created as an output from PROC TRANSPOSE with OPTIONS SETMISS=0; can that be the reason.
the thing which makes it more strange, is that when I ask SAS to print the observations with missing values, I get this result.
proc print data=x;
where missing(x) = 1;
var tcIHUB LABvalue RADIOvalue TRANSvalue x;
run;
Obs | tcIHUB | LABvalue | RADIOvalue | TRANSvalue | x |
1 | 0 | 0 | 1 | 0 | 0 |
---|---|---|---|---|---|
2 | 0 | 0 | 2 | 0 | 0 |
3 | 0 | 1 | 0 | 0 | 0 |
4 | 0 | 1 | 0 | 0 | 0 |
5 | 0 | 1 | 0 | 0 | 0 |
6 | 0 | 1 | 0 | 0 | 0 |
7 | 0 | 3 | 0 | 0 | 0 |
8 | 0 | 1 | 0 | 0 | 0 |
9 | 0 | 8 | 1 | 0 | 0 |
10 | 0 | 9 | 9 | 1 | 0 |
Do you get the same behavior in Proc Print with: WHERE X = .;?
Did the log for your data step where you calculated X have any warnings or notes?
The problem solved. it was due to OPTIONS SETMISS=0;
interestingly, if you have this option in SAS 9.3, the missing values in will be displayed as zeros but actually remain missing i the background and thus if you add them to another nonmissing variable the result will be missing, but shown as zeros in the output.
there is no error or warning in log. I think SAS should consider this in their hotfixes or next versions
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.
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.