1

When running the data.frame command in R (shown below - please note that "Macro" is my variable of interest within the model), I get an output for my variable, fit, se, lower, and upper. I am aware of what each output is telling me except fit.

> data.frame(effect(c("Macro"), model))
    Macro   fit        se         lower      upper
  1     C   45.30041   5.650558   34.14164   56.45918
  2     R   33.73317   4.394917   25.05406   42.41229

When I run the effect command (which I originally thought was giving me my standard deviation) I get the same numbers as fit:

> effect(c("macro"), model)
   Macro effect
   Macro
          C          R
   45.30041   33.73317

Is this truly the standard deviation, or is fit more representative of the mean? And, of course, there is always the option that I am completely off base with both of these potential interpretations.

  • It is the mean fit for the parameters C and R. This is not really a stats question except at a very basic level. – Carl Feb 21 '17 at 22:06
  • I'm voting to close this question as off-topic because it is more a programming output interpretation question than a stats question. – Carl Feb 21 '17 at 22:09
  • This is ambiguous, IMO, @Carl. We generally allow interpretation-of-output questions, even though they are somewhat software specific. OTOH, this seems less like the questions of that type that we leave open. – gung - Reinstate Monica Feb 21 '17 at 22:41
  • I do not see how you can say you know what lower and upper are if you do not know what fit is. –  Feb 22 '17 at 13:59
  • Woops! Sorry guys, a committee member and I were running through the code quickly and I must have written standard deviation in the wrong place. Please forgive this blunder, and - moving forward - do not degrade my question/comments unless you have something constructive to add to it. I am sincerely sorry if this is off topic though; I am still getting used to this website and what's accepted. – Megan Novak Feb 22 '17 at 17:14

1 Answers1

2

fit represents your fitted or predicted values given your regression model. In your case with categorical predictors, it's the mean:

library(effects) ## to access the effect() function

m1 <- lm(weight ~ group, data = PlantGrowth)

data.frame(effect(c("group"), m1))
  group   fit        se    lower    upper
1  ctrl 5.032 0.1971284 4.627526 5.436474
2  trt1 4.661 0.1971284 4.256526 5.065474
3  trt2 5.526 0.1971284 5.121526 5.930474

# CALCULATE MEANS
aggregate(weight ~ group, data = PlantGrowth, mean)
  group weight
1  ctrl  5.032
2  trt1  4.661
3  trt2  5.526

Not sure why you thought that effect() will give you the standard deviation. Have a look at ?effect to see what you will get when using the function.

Stefan
  • 727
  • 1
  • 9
  • 24