Hello!
My goal is to run a poisson regression, and I have the years separated in two 5-year groups as well as hispanic, race, and age variables that I'd also like to include.
So far I've only been able to include one variable in the regression, and I'm not quite sure how to go about including the other two as well. I've tried looking up guides but the code is off just enough for their suggestion to not work with what I've got.
The code that I have (that works) thus far is:
proc genmod data=edn.poisson5;
class year level ;
model count= year|level/ link=log dist=poisson offset=logTotalEmployment;
where variables = 'Hispanic';
lsmeans level/diff;
run;
I have tried to add the other variables (Race, Age) after "where variables =", but continue to be met with errors.
proc genmod data=edn.poisson5;
class year level ;
model count= year|level/ link=log dist=poisson offset=logTotalEmployment;
where variables = 'Age' and 'Hispanic' and 'Race';
lsmeans level/diff;
run;
After running the above code, I'm met with errors that look like this:
ERROR: Syntax error while parsing WHERE clause.
ERROR 22-322: Syntax error, expecting one of the following: ;, !, !!, &, *, **, +, -, /, <, <=, <>,
=, >, >=, AND, EQ, GE, GT, LE, LT, NE, NOT, OR, ^, ^=, |, ||, ~, ~=.
ERROR 76-322: Syntax error, statement will be ignored.
The data itself looks something like this:
20102014 Male 1 123 1,841,167 6.26509 6.68055 1.336109351
20102014 Race 1 101 1,708,200 6.23254 5.91266 1.18253132
20102014 Race 2 14 244,600 5.38846 5.72363 1.144726083
20102014 Race 3 1 212,400 5.32715 0.47081 0.094161959
20102014 Hispanic 1 56 521,000 5.71684 10.74856 2.149712092
20102014 Hispanic 0 64 1,688,400 6.22748 3.79057 0.758114191
20102014 Age 1 10 194,467 5.28885 5.14227 1.028454244
20102014 Age 2 34 459,571 5.66235 7.3982 1.479640795
20102014 Age 3 34 516,996 5.71349 6.57646 1.315291658
20102014 Age 4 30 582,415 5.76523 5.15096 1.03019254
20102014 Age 5 27 510,304 5.70783 5.29096 1.058192764
20152019 Male 1 164 2,276,200 6.35721 7.20499 1.440998155
20152019 Race 1 140 2,012,000 6.30363 6.95825 1.391650099
20152019 Race 2 18 343,200 5.53555 5.24476 1.048951049
20152019 Race 3 1 284,800 5.45454 0.35112 0.070224719
20152019 Hispanic 1 77 494,600 5.69425 15.56814 3.113627173
20152019 Hispanic 0 87 1,781,600 6.25081 4.88325 0.976650202
20152019 Age 1 17 179,247 5.25345 9.48414 1.896828169
20152019 Age 2 43 522,927 5.71844 8.22295 1.644589644
20152019 Age 3 31 509,290 5.70696 6.08691 1.217381538
20152019 Age 4 35 563,669 5.75102 6.20932 1.241863135
20152019 Age 5 38 577,881 5.76184 6.57574 1.315148749
I've been trying to figure this out for the last week or so, so any advice/guidance/help is greatly appreciated!
I'm using SAS 9 if that helps at all.