BookmarkSubscribeRSS Feed
Sadia_Sharmin
Calcite | Level 5

I have a panel data set with overdispersion. I want to run Fixed Effect and Random Effect Negative Binomial distribution model. I have SAS 9.4.

proc countreg data=CS.total groupid= loc;
class rtl(ref='0')majl (ref='2')minl (ref='2') ydr1 (ref='0') lftl (ref='0')/ param=ref;
model tot = majl minl lftl rtl majadt minadt ydr dui /dist=negbin errorcomp=fixed;
run;

SAS cannot recognize groupid, dist, errorcomp terms, as they didnt appear blue. How to code for my data structure?

 

Thanks in Advance 

4 REPLIES 4
Reeza
Super User

Colour  isn't indicative of correct code. Sadly the syntax highlighter isn't always correct. 

Did you get any errors? Are any of your statements not listed in the procedure documentation?

Sadia_Sharmin
Calcite | Level 5

Thank you for your reply dear Reeza.

Error: NEWAP  Optimization cannot be completed.

WARNING: The Hessian matrix is singular.

 

And I am not sure about my coding as couldnot find any example using this code. And my data structure is like :

data CS.total;
input loc t majl $ minl $ lftl $ rtl $ majadt minadt tev ydr ydr1 $ mdr odr dui tot FI PDO angle re ss;
datalines;
1 1 4 4 1 1 9.8020 8.8465 10.1274 4.9940 1 20.4509 0.0000 0.1429 7 3 4 2 2 0
1 2 4 4 1 1 9.7791 8.8235 10.1045 13.3351 3 9.6237 0.0000 0.0000 10 0 10 2 3 2
1 3 4 4 1 1 9.7886 8.8331 10.1141 8.3439 2 27.6996 0.0000 0.0909 11 5 6 6 2 0
1 4 4 4 1 1 9.8215 8.8660 10.1469 15.1548 4 17.6103 0.0000 0.0769 13 2 11 6 4 2.....

 

I have 15 loc variables 1-15 and time series variable for 21 years, so come characteristics reapeted over the same years but I have also random variables. I want to compare FENB, RENB and NB models for my data. Can you please help me out with SAS code which will work in SAS 9.4 version? And I am really confused about my coding.

Sadia_Sharmin
Calcite | Level 5

474 *Considering AADT/;
475 *-- FE Neg Bin Model --*/;


476 proc countreg data=CS.total groupid= loc;
NOTE: Writing HTML Body file: sashtml.htm
477 class rtl(ref='0')majl (ref='2')minl (ref='2') ydr1 (ref='0') lftl
477! (ref='0')/ param=ref;
478 model tot = majl minl lftl rtl majadt minadt ydr dui /dist=negbin
478! errorcomp=fixed;
479 run;

ERROR: NEWRAP Optimization cannot be completed.
NOTE: Optimization routine cannot improve the function value.
WARNING: The Hessian matrix is singular.

 

This is the programing log. From here I think ref for my categorical variables and errorcomp is not recognized by SAS.

TIA

Ksharp
Super User
Since it is a time series problem (SAS/ETS) , I suggest you post it at another forum:
Communities
SAS Forecasting and Econometrics




sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1524 views
  • 0 likes
  • 3 in conversation