Closed enriqueza closed 5 years ago
Hey @enriqueza thanks for posting! Any an all questions on HW are welcomed - this is collaborative effort. The fact that the significance of specific variables change depending on whether you run them individually or jointly is a very important thing to notice - so great job! Essentially what this is telling you is that not all of your explanatory variables are completely independent from each other. If they were then you wouldn't see the significance of those variables change. Did you examine all of the correlations in the dataset using a pairs
plot as we did in the lesson? Those plots help to make the correlation structures of the dataset clearer.
Just a quick question on the pairs function - How would you go about setting up the commands if you wanted to run the function for two different data subsets?
here is an example
# all data
pairs(iris)
# only those for versicolor
pairs(~ Sepal.Length + Sepal.Width + Petal.Length + Petal.Width + Species, subset = Species == "versicolor", data = iris)
# alternatively if you want to use . for all the variables
pairs(~ ., subset = Species == "versicolor", data = iris)
# alternatively you can manually subset
pairs(iris[iris$Species == "versicolor", ])
Oh, I hadn't thought of that. I will use it.
Hi all,
I'm having trouble understanding my linear model for fir trees. I ran a few models with just one single x variable and compared those models to see if they were different in terms of r squared values. I then made a linear model with all of the variables in it. What I don't understand is that the significance of the variables change when I added all those other variables. I guess I was wondering if anyone else had gotten significance in their models? (I hope that is ok to ask).
Here is some of my code for my fir tree model (this is without interactions):
I hope this question makes sense...