Looking for a bit of help on how to construct an equation for a linear model when there's a covariate involved.
I've been doing a simple lab assay where an absorbance measurement of an indicator can be compared back to a calibration curve of known concentrations of a reaction product to determine the concentration in the experiment. The calibration is easy - log of the concentration against log of the absorbance yields a straight line - so you can use the equation of the linear fit to get a concentration from an experimental absorbance value. I do the following in R:
fit <- lm(log(absorbance) ~ log(concentration))
Fine. Now, I wanted to do this assay at some temperatures different from the recommended temperature, and I had a suspicion that temperature may affect the assay, so I performed a calibration across some different temperatures.
I figured I'd just need the same linear model, but with temperature added in as a covariate, so I did this:
temp_fit <- lm(log(absorbance) ~ log(concentration) + temperature)
Which returns the following:
> summary(temp_fit)
Call:
lm(formula = log(absorbance) ~ log(concentration) + temperature, data = dataset_temperature)
Residuals:
Min 1Q Median 3Q Max
-0.151634 -0.056414 0.000995 0.068044 0.140767
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -1.5644882 0.0264804 -59.08 <2e-16 ***
log(concentration) -0.4217933 0.0099906 -42.22 <2e-16 ***
Temperature -0.0009536 0.0005268 -1.81 0.0755 .
Residual standard error: 0.07586 on 57 degrees of freedom
Multiple R-squared: 0.9691, Adjusted R-squared: 0.968
F-statistic: 892.9 on 2 and 57 DF, p-value: < 2.2e-16
Which suggests to me that the temperature does have an effect, albeit not with a p-value < 0.05.
Now my problem is that I don't know from this point how to go about making an equation for this model with the added temperature factor. Any advice on how to do this would be much appreciated, or advice on whether I'm even going about this the right way. Thanks!