I have an "partially" full factorial designed experiment (3 factors) that looks like this (both VAR1 and VAR2 are numeric factors):
As you can see, Population A and B share all of VAR2 levels and the "0" middle level of VAR1. Is there a name for this type of design?
The model would be
Model: Y = B0+ B1*VAR1 + B2*VAR2 + B3*POP + B4*POPxVAR1 + B5*POPxVAR2
Where Y is the logit and VAR 1 is numeric and VAR 2 is numeric (POP is binary)
I want to estimate the effect of each main effect (VAR 1 and Var 2) for population A and B (i.e. through an interaction) without extrapolating outside of the limits of what factors Population A and B were exposed to.
Is this possible (I dont want to just subset the data for separate regressions)?
2. Will the coefficients be biased from this model?
I was actually quite surprised by what happens when you fit a full model to the above data, versus a subset. I think this suggests my concern for bias in the coefficients is not a true concern?
I created some fake data for this, but the large sample sizes are roughly close.
NOTE: Regardless of my coding above, the actual levels are not equally spaced!
Here is the full model:
population<-c(0,0,0,0,1,1,1,1) VAR1<-c(300,300,500,500,500,500,1000,1000) VAR2<-c(500,2500,500,2500,500,2500,500,2500) non_resp<-c(49917,49975,49833,49900,24962,24977,24978,24968) response<-c(83,25,167,100,38,23,22,32) Y<-cbind(response,non_resp) X<-data.frame(population=population,Var1=VAR1,Var2=VAR2) summary(glm(Y~population+Var1+Var2+population*Var1+population*Var2, data=X, family = binomial))
Which results in these coeff:
Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) -7.728e+00 2.655e-01 -29.111 < 2e-16 *** population 1.207e+00 4.161e-01 2.900 0.00373 ** Var1 4.534e-03 5.707e-04 7.946 1.93e-15 *** Var2 -3.473e-04 5.483e-05 -6.335 2.38e-10 *** population:Var1 -4.778e-03 6.823e-04 -7.004 2.49e-12 *** population:Var2 3.038e-04 1.083e-04 2.805 0.00503 **
If we subset to only Population =0 the coefficients for Var1 and Var2 are the same, as are the SE
X_sub<-subset(X,population ==0) Y_sub<-Y[1:4,] summary(glm(Y_sub~Var1+Var2, data=X_sub, family = binomial))
We get the following:
Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) -7.728e+00 2.655e-01 -29.111 < 2e-16 *** Var1 4.534e-03 5.707e-04 7.946 1.93e-15 *** Var2 -3.473e-04 5.483e-05 -6.335 2.38e-10 ***