[R] for Interaction of continous var and categorical var, any way approach the categorical var to continous ?

Yong Wang wangyong1 at gmail.com
Thu Mar 26 23:15:14 CET 2009


Dear list,

This is NOT a techical question ragrding use of R.

I have a linear model where the response variable is neigborhood
safety . It is projected poverty deteriorate safety and number of
officers per thousand residents improve safety. The focal hypothesis
is poverty poses less safety threat when officers number is high.

To check the focal hypothesis, the continuous variable "officers" is
recoded as catogorical with two levels (high and low). the results is
below and support the hyothesis

#=========================================
model <- lm(neigborhood safety ~ poverty * officers)
The coefficients (all significant):
poverty                -0.05
officers                 0.058
poverty : officers    0.014
#==========================================

My question is how to check the weakened "poverty" effect with a
minuscle increase of "officers". the coeeficient for the interaction
term of continous "poverty" and "officers" is hard to interpret and is
not suitable to check the focal hypothesis since, say, (povety=3 &
officers=8) will be the same as (poverty=8 & officer=3).

Thanks a lot in advance for any suggestions!

Sincerely,

Will




More information about the R-help mailing list