I am having some problems trying to create a double-log model using R.
I have a set of explanatory/independent variables, and I have already made a linear model using those variables. (by using:Now, I have to make a double-log model using the same variables, and compare it to the linear model.Code:
model <-lm("dependent variable"~X1+X2+X3+X4,data="name of my data set")
My problem is that I keep failing in making the double-log model using R. I have even had trouble trying to find tutorials online.
If anyone has some knowledge in this department, it would be great.
Anyways, I tried(ignore the names of those variables if they don't helpCode:
Try this:As you can see all I did is wrap each log in a call to the I() function. You can see ?I for a full description of what this does but basically it says to evaluate the mathematical expression as it appears rather than attempting to interpret the logs as part of the formula object.Code:
In God we trust. All others must bring data.
~W. Edwards Deming
Advertise on Talk Stats