simu_rev2 | R Documentation |
Calculate temporal reversal for each replicate of simulated coefficients
simu_rev2(simu, col1, col2)
simu |
An array of simulated individual coefficients based on their uncertainties(output of simu_coefs) |
col1 |
Column of the variable of interest for the 1st temporal period |
col2 |
Column of the variable of interest for the 2nd temporal period |
A matrix of reversal (one value for each covariates and replicates)
data(goats)
goats$Season<-c("1", "2")
ls1<-list()
ls1[[1]]<-as.formula(STATUS~(ELEVATION+SLOPE+ET+ASPECT+HLI+TASP):Season)
out<-rsf_ind(goats$ID, data=goats, form_ls=ls1)
coef<-ind_coef(m=1, out)
se<-ind_se(m=1, out)
simu<-simu_coefs(coef, se, n=100)
head(coef)
rev_elevation<-simu_rev2(simu, 3, 4) #Calculate specialization for elevation covariate
quantile(rev_elevation) #Show variation around estimate of elevation covariate
mean(rev_elevation) #Calculate average reversal for elevation covariate
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.