I have no idea where I came across this code, but I am modeling biological activity of plant tannins in response to an environmental variable (yes,no format) and two continuous variables. The format I was using is:
mod=lm(response~treat/continuousvar1+treat/continuousvar2-1)
My output looks like this, and I think that it is giving me two multiple regressions, one in each environmental treatment (with yes and no rows giving intercepts) and both continuous predictors slopes within that regression. But, if that's the case, what is up with reporting the overall model p value and R^2? If I do this with a single continuous variable, I get back the same slopes and intercepts as when I split the data into yes and no treatments and fit a regression line. The big questions being: is it doing what I think it is, and what can I make of the overall model p?
Call:
lm(formula = stemnit ~ treat/pbo + treat/nitrogenprcnt - 1)
Residuals:
Min 1Q Median 3Q Max
-0.199408 -0.024005 -0.003304 0.039079 0.149653
Coefficients:
Estimate Std. Error t value Pr(>|t|)
treatNo 0.84716 0.37564 2.255 0.0478 *
treatYes 0.61179 0.50882 1.202 0.2569
treatNo:pbo 0.06525 0.53332 0.122 0.9050
treatYes:pbo 0.39890 0.42716 0.934 0.3724
treatNo:nitrogenprcnt 0.01604 0.33802 0.047 0.9631
treatYes:nitrogenprcnt 0.22960 0.46016 0.499 0.6286
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.1123 on 10 degrees of freedom
Multiple R-squared: 0.9909, Adjusted R-squared: 0.9854
F-statistic: 181 on 6 and 10 DF, p-value: 1.309e-09