Discussion:
Dealing with the "not enough observations" error
(too old to reply)
Chandler Armstrong
2008-08-07 21:07:49 UTC
Permalink
Hello,

I'm working with a massive time-series cross-section dataset that has a lot
of missing data spread across the cases and time.

when I try to run a TSCSREG program, I first get this "there is only one
cross section of time series observation" error. I think I know how to fix
this using SAS commands to count cases within a time series, but so far I've
just manually sorted through the data and found the cases that only have one
observation in a time series.

Next, I get an error of "not enough observations with non-missing model
variables for model statement in cross section 'csid'='x'; where 'csid' is
the cross section identifier and 'x' is the value of that identifier. I
can't think of a way to possibly use SAS to automatically delete the
offending cases, though I have a feeling there is something really simple to
solve it that I just don't know about. Currently, I am having to run the
program, check the log, open the dataset, delete the offending cases, close
the dataset, run the program, check the log, open the dataset, delete the
offending cases... ad infinitum. Does anybody know of a way to work with
these kinds of errors in the data without having to do so much manual work?

I think programs such as STATA just automatically dump the useless cases.
Why doesn't SAS? I really want to use SAS over STATA, but if it is this
fussy with data, I don't know if I can take much more of it.

Chandler
Sigurd Hermansen
2008-08-07 23:05:30 UTC
Permalink
Chandler:
The SQL solution,

proc sql;
create table csLargeEnough as
select * from tsdata
group by csid having count(*)>= n
;
quit;

will limit the dataset csLargeEnough to groups of tuples (rows) in
each cross-section of at least n tuples.
S

-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-***@LISTSERV.UGA.EDU] On Behalf Of
Chandler Armstrong
Sent: Thursday, August 07, 2008 5:08 PM
To: SAS-***@LISTSERV.UGA.EDU
Subject: Dealing with the "not enough observations" error


Hello,

I'm working with a massive time-series cross-section dataset that has a
lot of missing data spread across the cases and time.

when I try to run a TSCSREG program, I first get this "there is only one
cross section of time series observation" error. I think I know how to
fix this using SAS commands to count cases within a time series, but so
far I've just manually sorted through the data and found the cases that
only have one observation in a time series.

Next, I get an error of "not enough observations with non-missing model
variables for model statement in cross section 'csid'='x'; where 'csid'
is the cross section identifier and 'x' is the value of that identifier.
I can't think of a way to possibly use SAS to automatically delete the
offending cases, though I have a feeling there is something really
simple to solve it that I just don't know about. Currently, I am having
to run the program, check the log, open the dataset, delete the
offending cases, close the dataset, run the program, check the log, open
the dataset, delete the offending cases... ad infinitum. Does anybody
know of a way to work with these kinds of errors in the data without
having to do so much manual work?

I think programs such as STATA just automatically dump the useless
cases. Why doesn't SAS? I really want to use SAS over STATA, but if it
is this fussy with data, I don't know if I can take much more of it.

Chandler

Loading...