CI for individual covariates with interactions

questions concerning analysis/theory using programs M-SURGE, E-SURGE and U-CARE

CI for individual covariates with interactions

Postby Hoy » Wed Oct 29, 2014 10:45 am

Hi,

I have 2 age classes and I am interested in determining the effect of two covariates,( 1 environmental (temporal) and the other individual) on the survival of the older age class only.
Model selection based on AIC suggest that the below is the ‘best model’:

a(7:15).[i+xind(3)+t(1_33)*x(1)+xind(3).t(1_33)*x(1)]+a(1:6)

To understand the interaction I have plotted the predicted values for survival for a range of values for the environmental covariate and fixing the individual covariate at the lower, median and upper quartile values. Which I have done using the Beta estimates from my model in R.

However now I want to calculate the CI surrounding these predicted values but am unsure how to calculate them when there are both environmental and individual covariates and an interaction between them as the only examples I can find for estimating CI for individual covariates alone and do not include any temporal covariates.

Any help as to how to do this would be greatly appreciated.

Many thanks in advance

Sarah
Hoy
 
Posts: 9
Joined: Tue Feb 12, 2013 11:34 am

Re: CI for individual covariates with interactions

Postby Guillaume Souchay » Wed Oct 29, 2014 11:01 am

Hi Sarah

To compute the CI around the predicted value of the survival, you have to use the delta-method.
The thing is to rely on the logit formula (with both individual and temporal covariate) to compute survival and use the delta-method.
Explanation and some examples are provided in the Appendix B "the delta method" of the Mark Book.
There is no R code in the appendix but it should be helpful.

Cheers,
Guillaume
Guillaume Souchay
 
Posts: 64
Joined: Wed Feb 27, 2008 5:20 am
Location: Nantes, FRANCE

Re: CI for individual covariates with interactions

Postby Hoy » Wed Oct 29, 2014 2:01 pm

Hi Guillaume,

thanks for this it was helpful. I also found some code for calculating CI’s in MATLAB on the forum (but have never used MATLAB before).

I just wanted to check that for my model which includes an interaction term that is it correct to calculate the CI for each survival estimate in the following way??????

I have used the below formula to calculate the survival estimate, which I think is right (where X1 and X2 is a specific value of each covariate. Then I back-transformed the survival estimate from the logit scale.

logit survival = B1 + B1.X1 + B2.X2 + B3.X1.X2

Then to calculate the CI for the estimate I did the following

# the matrix of the variance-covariance
A <- c(0.05112422, -0.05489988, 0.01455752, -0.01226207, -0.05489988, 0.10415181, -0.01491851, 0.00191577, 0.01455752, -0.01491851, 0.06882921, -0.06714778, -0.01226207, -0.00191577,
-0.06714778, 0.11552529)

#vector of standardised covariate values
# as there is an interaction term in the model the last value is product of the first two.
W<- c(-2.6, -0.29497, 0.766922)

# vector of beta estimates
beta <-( 1.488253686, -0.693064709, 0.890272454, -0.810708591)

phi <- (back transformed survival estimate I calculated using the above formula)

# computation of variance for survival
phivar <- phi*(1-phi)
U<- phivar*(W)
Varphi <- U*A*U

# CI for survival
LCIphi <- (phi -1.96 *sqrt(Varphi))
UCIphi <- (phi +1.96 *sqrt(Varphi))

Does this seem sensible?

Many thanks in advance

Sarah
Hoy
 
Posts: 9
Joined: Tue Feb 12, 2013 11:34 am

Re: CI for individual covariates with interactions

Postby Guillaume Souchay » Thu Oct 30, 2014 4:04 am

Hi Sarah,

I just wanted to check that for my model which includes an interaction term that is it correct to calculate the CI for each survival estimate in the following way??????

The delta method is used to calculate the variance of any parameter derived from another. Thus, you can use this method to compute variance of annual survival from product of seasonal survivals or in your case.

I'm sure to fully understand what you did.
The delta method used both partial derivative of Phi with respect to each component of Phi and the var-cov matrix of the component of Phi.
The general formula (also mention in the Mark Book) is:
Image

where D is the vector of partial derivative of Phi with respect to each component and E, the matrix of variance-covariance and Y is the interest estimate.
Then, for each value of Phi, you can compute associated variance and then the confidence interval on the logit scale, and then back-transformed the 95% CI (this is better to ensure that the 95% CI is bounded between 0 and 1).
In our process I don't see the derivative part, so it is maybe another method than the delta-method.
In the Mark book, you can see the difference between your method (varphi = [phi(1-phi)]^2 * var(beta) ).

All is clearly explained in the Appendix B (why computes the 95%CI on the logit scale rather than the biological sclae, what is Delta Method, etc.).
The "harder" part of this method is to compute the partial derivative, however, there is a function in R - function deriv(), that can help you to compute it.

Hope it can help.

Cheers,

Guillaume
Guillaume Souchay
 
Posts: 64
Joined: Wed Feb 27, 2008 5:20 am
Location: Nantes, FRANCE

Re: CI for individual covariates with interactions

Postby Hoy » Thu Oct 30, 2014 6:49 am

Hi Guillaume,

Great thanks I have got it now.

Really appreciate your all help

Thanks

Sarah
Hoy
 
Posts: 9
Joined: Tue Feb 12, 2013 11:34 am


Return to analysis help

Who is online

Users browsing this forum: No registered users and 9 guests