[R] Correct coefficients from treatment contrasts?
David Winsemius
dwinsemius at comcast.net
Mon Sep 6 15:32:51 CEST 2010
On Sep 6, 2010, at 4:03 AM, B W wrote:
<Snipped out formatting detritus and added back many missing speces.>
> ->Hello,I am trying to take the information from the summary of my
> best fit logisticregression model for the occurrence of a high
> elevation plant spp. and create the appropriate equation that will
> calculate probability of occurrence, given the data. My predictors
> include both continuous variables (slope and a second
> orderpolynomial of elevation) and a discrete variable for aspect
> (warm and cool). I have left unchanged the default contrasts option,
> so I believe that thefollowing coefficients were created using
> treatment contrasts. My question how can I take this summary output
> and create the logistic equation that will allow me to calculate
> probability of occurrence. My interests are touse this to spatially
> display this info in a GIS environment.
I think you should:
-- Read the Posting Guide where you should learn that this is a plain
text mailing list and that you need to change the configuration of
your mail client.
-- Read the help page and read other documentation regarding the use
of the predict function.
> I have made adraft equation (shown below) that uses the coefficients
> from this summaryoutput, but this appears to be incorrect values
> always return zeroprobabilities. Presumably I need to adjust the
> values in some way but I am unclear as to how to proceed.
> Anyguidance would be appreciated!
> >summary (
> Call:glm(formula= Po ~ Slope + poly(Elevation, 2) + Aspect_2, family
> = quasibinomial) DevianceResiduals: Min 1Q Median
> 3Q Max -1.0532 -0.4167 -0.2760 -0.1823 3.3376
> Coefficients: Estimate Std. Error t valuePr(>|
> t|) (Intercept) -4.577707 0.222406 -20.583 < 2e-16 ***
> Slope 0.039959 0.003593 11.121 < 2e-16 ***
> poly(Elevation,2)1 8.050898 5.601956 1.437 0.1508
> poly(Elevation,2)2 -37.694521 6.297806 -5.985 2.39e-09 ***
> Aspect_2w 0.429229 0.174760 2.456 0.0141 * ---
You may get predictions at the original data points with:
pred < predict(model.Slope.Elevation.Aspect)
> (1/ (1 + exp(-1 * (-4.577707 + 0.039959*Slope + 8.050898 *
> poly(Elevation, 2)1 + -37.694521 * poly(Elevation, 2)2 + 0.429229*
> Aspect_2w)))))
>
> Brendan Wilson
> 2530 Alexis Road
> Shoreacres BC
> Canada V1N 4P6
> Ph: 1.250.359.5905
>
>
>
> [[alternative HTML version deleted]]
David Winsemius, MD
West Hartford, CT
More information about the R-help
mailing list