dmcglinn / quant_methods

Applied Quantitative Methods course at the College of Charleston
http://dmcglinn.github.io/quant_methods/
Other
18 stars 26 forks source link

Issues with Interaction Effect Model for Abies fraseri... Leverage points #43

Closed jensenac closed 5 years ago

jensenac commented 5 years ago

Hey guys,

I'm having an issue with a few of my models for Abies fraseri. Specifically with my interaction model.

abi_int_mod<- lm(cover~elevtcistreamdistdisturbbeers, data=ABI) abi_int_mod plot(abi_int_mod)

When I run the code, I get the message "not plotting observations with leverage one" and a bunch of NAs are listed. I know this code worked for Acer rubrum, so I'm wondering if the errors I am getting are from particular data points in the sample? This error is affecting my Anova analysis too.

Anyone else with this issue, or a suggestion?

I will try to post screen shots of my issue below.

screen shot 2019-02-04 at 8 50 14 pm

screen shot 2019-02-04 at 8 49 17 pm

jensenac commented 5 years ago

I'm guessing the error might have something to do with the disturb values? Any insight would be totally rad. Thanks, guys!

screen shot 2019-02-04 at 9 00 54 pm

dmcglinn commented 5 years ago

This code works for me without errors:

trees <- read.csv('./data/treedata.csv')
ABI <- subset(trees, species = "Abies fraseri")
abi_int_mod <- lm(cover ~ elev * tci * streamdist * disturb * beers, data=ABI)
summary(abi_int_mod)

Which makes me think something happened to your object ABI that is causing a bug. Can you run my code snippet and see if it works.

Also this brings up the question of whether or not the all interaction model is a useful model to consider. Let's say hypothetically it was found to be the best model using AIC - how would you explain this model to stake holders that need to manage the forest? Remember a model is only as useful as we can use it. So at the outset we need to think carefully about how we plan to use the model (exploratory / testing / prediction / some combination).

Also this is minor but these issues are github flavored markdown so if you wrap your code chunks with the 3 grave accents then it will be properly formatted.