# How to calculate a regression model with quadratic factors?

I'd appreciate your help. I want to obtain the equation shown in the image considering the quadratic factors of the approximation. Using lm() from the lmtest package
Cp<- c(0.4153, 0.4572, 0.26, 0.1446, 0.0749, 0.2778, 0.294, 0.4074, 0.0912, 0.2541, 0.0855, 0.444, 0.0983, 0.4263, 0.0712, 0.1286, 0.2951, 0.1389, 0.128, 0.3865, 0.5113, 0.5478, 0.2631, 0.4023, 0.2962, 0.2962, 0.2962)
L<- c(-1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0)
p<- c(-1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0)
α<- c(-1, -1, -1, -1, 1, 1, 1, 1, -1, -1, -1, -1, 1, 1, 1, 1, 0, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0)
Di/Do<- c(-1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, -1, 1, 0, 0, 0)

Hi. I don't get your regression equation, but here is my attempt:

df <- data.frame(
Cp= c(0.4153, 0.4572, 0.26, 0.1446, 0.0749, 0.2778, 0.294, 0.4074, 0.0912, 0.2541, 0.0855, 0.444, 0.0983,
0.4263, 0.0712, 0.1286, 0.2951, 0.1389, 0.128, 0.3865, 0.5113, 0.5478, 0.2631, 0.4023, 0.2962, 0.2962, 0.2962),
L= c(-1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0),
p= c(-1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0),
a= c(-1, -1, -1, -1, 1, 1, 1, 1, -1, -1, -1, -1, 1, 1, 1, 1, 0, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0),
DiDo= c(-1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, -1, 1, 0, 0, 0))

lm(Cp ~ L + p + a + DiDo + Lp + La + LDiDo + pa + p*DiDo + I(L^2) + I(p^2) + I(a^2) + I(DiDo^2), df)

Coefficients:
(Intercept) L p a DiDo I(L^2)
3.362e-01 5.519e-02 -7.222e-05 -1.872e-02 -3.293e-02 -1.391e-01
I(p^2) I(a^2) I(DiDo^2) L:p L:a L:DiDo
-9.888e-02 1.734e-01 -2.343e-02 -2.011e-02 1.586e-02 4.150e-02
p:a p:DiDo
1.923e-02 -1.338e-03

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.