I'm so new to SAS, and I need to do NB regression using Genmod procedure for my project. it's proved that there is a correlation between the data I've got. but when I apply my data, it estimates the parameter by 0.
Could anybody help me? This is how I did it:
"data crash;
input major minor accident;
datalines;
19331 18358 10
17215 17051 10
18539 17562 9
42890 14750 38
43187 14600 46
44136 14020 44
60903 9819 41
59018 10547 49
65205 11292 40
31969 21677 40
31808 23356 31
28179 19647 45
29020 38400 78
29100 38408 64
29080 39560 54
31969 25190 57
31808 25481 51
28179 25092 49
32172 34898 56
33412 35950 41
32068 33307 50
30217 15094 41
30581 16782 31
32458 16560 33
run;
proc genmod data=crash;
model accident = major minor / dist=negbin link=log;
run; "
Your predictors are very large relative to the response variable. SAS is rounding the parameter estimates to 0.0000, even though they are not really 0. In a data step, add:
major1=major/10000;
minor1=minor/10000;
Then, use major1 and minor1 in the model statement of genmod. You will get correct nonzero parameter estimates. In reporting or using the results, remember to rescale the parameters by dividing by 10000.
One more question. in proc genmod, is there anyway I can see the functional form of the regression model. For this example how these variables are related?
Thanks
This is given explicitly in the table of maximum likelihood estimates in the output. Each line is the parameter estimate for the predictor variable. Note that everything is in the scale of the link function used. You need to read the online documentation -- many examples of interpretation of the output.
NOTE: The negative binomial dispersion parameter was estimated by maximum likelihood.
this shows the estimated parameters for each variable. my question is that what is the functional form. Is it like
accident= 0.0271(major1)+0.0378(minor1)+1.8966
or is there any option that shows how do they relate?
thanks
For generalized linear models, the inverse of the link function transforms the linear predictor eta back to produce the expected value of the response. When you employ a log link (as you stated in your first post), the inverse of the log link is exponentiation, and the expected value of the response is given as
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.