set.seed(89)library(ggplot2)library(cjbart)#> Loading required package: BART#> Loading required package: nlme#> Loading required package: nnet#> Loading required package: survivalThis vignette provides a brief example of how to estimateheterogeneous effects in conjoint experiments, using .
We first simulate a basic conjoint design for the purpose ofillustration. Suppose we conducted a conjoint experiment on 100individuals, where each individual makes 5 discrete choices between twoprofiles. Each profile has three attributes (A-E), and we also recordtwo covariates for each subject. The resulting data contains 1000observations.
subjects<-100rounds<-5profiles<-2obs<- subjects*rounds*profilesfake_data<-data.frame(A =sample(c("a1","a2","a3"), obs,replace =TRUE),B =sample(c("b1","b2","b3"), obs,replace =TRUE),C =sample(c("c1","c2","c3"), obs,replace =TRUE),D =sample(c("d1","d2","d3"), obs,replace =TRUE),E =sample(c("e1","e2","e3"), obs,replace =TRUE),covar1 =rep(runif(subjects,0 ,1),each = rounds),covar2 =rep(sample(c(1,0), subjects,replace =TRUE),each = rounds),id1 =rep(1:subjects,each=rounds),stringsAsFactors =TRUE)fake_data$Y<-ifelse(fake_data$E=="e2",rbinom(obs,1, fake_data$covar1),sample(c(0,1), obs,replace =TRUE))To estimate a conjoint model on this data we will use thecjbart() function, which uses Bayesian Additive RegressionTrees (BART) to approximate the relationships between the outcome (abinary choice), the randomized attribute-levels, and the includedcovariates. For the sake of efficiency in this example, we reduce thenumber of trees (ntree) and cuts (numcut) usedto estimate the BART model. More generally, users can pass arguments tothe underlying BART algorithm (see?BART::pbart) directlyfrom thecjbart function to adjust the modelhyperparameters:
cj_model<-cjbart(data = fake_data,Y ="Y",id ="id1",ntree =15,numcut =20)#> Detected forced-choice outcomeTo generate heterogeneity estimates at the observation- andindividual-level, we use theIMCE() function. We pass inboth the original experimental data, and the conjoint model generated inthe last step. At this point, we also declare the names of the conjointattribute variables (attribs) and the reference category wewant to use for each attribute when calculating the marginal componenteffects (ref_levels). The vector of reference levels mustbe of the same length asattribs, with the level atpositioni corresponding to theattrib[i]:
het_effects<-IMCE(data = fake_data,model = cj_model,attribs =c("A","B","C","D","E"),ref_levels =c("a1","b1","c1","d1","e1"),cores =1)#> Calculating OMCEs for attribute: A [1/5]#> Calculating OMCEs for attribute: B [2/5]#> Calculating OMCEs for attribute: C [3/5]#> Calculating OMCEs for attribute: D [4/5]#> Calculating OMCEs for attribute: E [5/5]#> Calculating IMCEsIMCE() returns an object of class “cjbart”, whichcontains the individual-level marginal component effects (IMCEs),matrices reflecting the upper and lower values of each estimate’sconfidence interval respectively, and optionally the underlyingobservation-level marginal component effects (OMCEs) whenkeep_omces = TRUE.
It is likely that users will want to compare the conjoint estimationstrategy to other estimation strategies, such as logistic regressionmodels. We can recover the average marginal component effect (AMCE) forthe BART model using thesummary() command:
summary(het_effects)#> Individual marginal component effects (IMCEs)#> # A tibble: 10 × 6#> Attribute Level AMCE Min. Max. Std.Dev#> <chr> <chr> <dbl> <dbl> <dbl> <dbl>#> 1 A a2 0.0779 0.0343 0.106 0.0145#> 2 A a3 0.0218 0.00345 0.0348 0.00628#> 3 B b2 0.0175 0.00988 0.0229 0.00273#> 4 B b3 0.00159 -0.00408 0.00638 0.00211#> 5 C c2 -0.0262 -0.0571 0.000908 0.0120#> 6 C c3 -0.0393 -0.0750 -0.0104 0.0147#> 7 D d2 0.0115 0.00739 0.0158 0.00192#> 8 D d3 0.0116 0.00407 0.0182 0.00479#> 9 E e2 0.0348 -0.199 0.412 0.205#> 10 E e3 -0.00668 -0.0254 0.0158 0.00929We can plot the IMCEs, color coding the points by some covariatevalue, using the in-builtplot() function:
To aid presentation, the plot function can restrict whichattribute-levels are displayed by using theplot_levelsargument:
We can estimate the importance of covariates to the model using the
het_vimp() function, which calculates standardizedimportance scores using random forest-based permutation tests. Callingplot() on the result will return a heatmap of these scoresfor each combination of attribute-level and covariate (users canrestrict which attribute levels and covariates are considered, see thedocumentation for more details):
vimp_estimates<-het_vimp(imces = het_effects,cores =1)#> Calculating importance metrics for attribute-level: a3#>|||0%||=|1%||=|2%||==|3%||===|4%||====|5%||====|6%||=====|7%||======|8%||======|9%||=======|10%||========|11%||========|12%||=========|13%||==========|14%||==========|15%||===========|16%||============|17%||=============|18%||=============|19%||==============|20%||===============|21%||===============|22%||================|23%||=================|24%||==================|25%||==================|26%||===================|27%||====================|28%||====================|29%||=====================|30%||======================|31%||======================|32%||=======================|33%||========================|34%||========================|35%||=========================|36%||==========================|37%||===========================|38%||===========================|39%||============================|40%||=============================|41%||=============================|42%||==============================|43%||===============================|44%||================================|45%||================================|46%||=================================|47%||==================================|48%||==================================|49%||===================================|50%||====================================|51%||====================================|52%||=====================================|53%||======================================|54%||======================================|55%||=======================================|56%||========================================|57%||=========================================|58%||=========================================|59%||==========================================|60%||===========================================|61%||===========================================|62%||============================================|63%||=============================================|64%||==============================================|65%||==============================================|66%||===============================================|67%||================================================|68%||================================================|69%||=================================================|70%||==================================================|71%||==================================================|72%||===================================================|73%||====================================================|74%||====================================================|75%||=====================================================|76%||======================================================|77%||=======================================================|78%||=======================================================|79%||========================================================|80%||=========================================================|81%||=========================================================|82%||==========================================================|83%||===========================================================|84%||============================================================|85%||============================================================|86%||=============================================================|87%||==============================================================|88%||==============================================================|89%||===============================================================|90%||================================================================|91%||================================================================|92%||=================================================================|93%||==================================================================|94%||==================================================================|95%||===================================================================|96%||====================================================================|97%||=====================================================================|98%||=====================================================================|99%||======================================================================|100%#> Calculating importance metrics for attribute-level: a2#>|||0%||=|1%||=|2%||==|3%||===|4%||====|5%||====|6%||=====|7%||======|8%||======|9%||=======|10%||========|11%||========|12%||=========|13%||==========|14%||==========|15%||===========|16%||============|17%||=============|18%||=============|19%||==============|20%||===============|21%||===============|22%||================|23%||=================|24%||==================|25%||==================|26%||===================|27%||====================|28%||====================|29%||=====================|30%||======================|31%||======================|32%||=======================|33%||========================|34%||========================|35%||=========================|36%||==========================|37%||===========================|38%||===========================|39%||============================|40%||=============================|41%||=============================|42%||==============================|43%||===============================|44%||================================|45%||================================|46%||=================================|47%||==================================|48%||==================================|49%||===================================|50%||====================================|51%||====================================|52%||=====================================|53%||======================================|54%||======================================|55%||=======================================|56%||========================================|57%||=========================================|58%||=========================================|59%||==========================================|60%||===========================================|61%||===========================================|62%||============================================|63%||=============================================|64%||==============================================|65%||==============================================|66%||===============================================|67%||================================================|68%||================================================|69%||=================================================|70%||==================================================|71%||==================================================|72%||===================================================|73%||====================================================|74%||====================================================|75%||=====================================================|76%||======================================================|77%||=======================================================|78%||=======================================================|79%||========================================================|80%||=========================================================|81%||=========================================================|82%||==========================================================|83%||===========================================================|84%||============================================================|85%||============================================================|86%||=============================================================|87%||==============================================================|88%||==============================================================|89%||===============================================================|90%||================================================================|91%||================================================================|92%||=================================================================|93%||==================================================================|94%||==================================================================|95%||===================================================================|96%||====================================================================|97%||=====================================================================|98%||=====================================================================|99%||======================================================================|100%#> Calculating importance metrics for attribute-level: b2#>|||0%||=|1%||=|2%||==|3%||===|4%||====|5%||====|6%||=====|7%||======|8%||======|9%||=======|10%||========|11%||========|12%||=========|13%||==========|14%||==========|15%||===========|16%||============|17%||=============|18%||=============|19%||==============|20%||===============|21%||===============|22%||================|23%||=================|24%||==================|25%||==================|26%||===================|27%||====================|28%||====================|29%||=====================|30%||======================|31%||======================|32%||=======================|33%||========================|34%||========================|35%||=========================|36%||==========================|37%||===========================|38%||===========================|39%||============================|40%||=============================|41%||=============================|42%||==============================|43%||===============================|44%||================================|45%||================================|46%||=================================|47%||==================================|48%||==================================|49%||===================================|50%||====================================|51%||====================================|52%||=====================================|53%||======================================|54%||======================================|55%||=======================================|56%||========================================|57%||=========================================|58%||=========================================|59%||==========================================|60%||===========================================|61%||===========================================|62%||============================================|63%||=============================================|64%||==============================================|65%||==============================================|66%||===============================================|67%||================================================|68%||================================================|69%||=================================================|70%||==================================================|71%||==================================================|72%||===================================================|73%||====================================================|74%||====================================================|75%||=====================================================|76%||======================================================|77%||=======================================================|78%||=======================================================|79%||========================================================|80%||=========================================================|81%||=========================================================|82%||==========================================================|83%||===========================================================|84%||============================================================|85%||============================================================|86%||=============================================================|87%||==============================================================|88%||==============================================================|89%||===============================================================|90%||================================================================|91%||================================================================|92%||=================================================================|93%||==================================================================|94%||==================================================================|95%||===================================================================|96%||====================================================================|97%||=====================================================================|98%||=====================================================================|99%||======================================================================|100%#> Calculating importance metrics for attribute-level: b3#>|||0%||=|1%||=|2%||==|3%||===|4%||====|5%||====|6%||=====|7%||======|8%||======|9%||=======|10%||========|11%||========|12%||=========|13%||==========|14%||==========|15%||===========|16%||============|17%||=============|18%||=============|19%||==============|20%||===============|21%||===============|22%||================|23%||=================|24%||==================|25%||==================|26%||===================|27%||====================|28%||====================|29%||=====================|30%||======================|31%||======================|32%||=======================|33%||========================|34%||========================|35%||=========================|36%||==========================|37%||===========================|38%||===========================|39%||============================|40%||=============================|41%||=============================|42%||==============================|43%||===============================|44%||================================|45%||================================|46%||=================================|47%||==================================|48%||==================================|49%||===================================|50%||====================================|51%||====================================|52%||=====================================|53%||======================================|54%||======================================|55%||=======================================|56%||========================================|57%||=========================================|58%||=========================================|59%||==========================================|60%||===========================================|61%||===========================================|62%||============================================|63%||=============================================|64%||==============================================|65%||==============================================|66%||===============================================|67%||================================================|68%||================================================|69%||=================================================|70%||==================================================|71%||==================================================|72%||===================================================|73%||====================================================|74%||====================================================|75%||=====================================================|76%||======================================================|77%||=======================================================|78%||=======================================================|79%||========================================================|80%||=========================================================|81%||=========================================================|82%||==========================================================|83%||===========================================================|84%||============================================================|85%||============================================================|86%||=============================================================|87%||==============================================================|88%||==============================================================|89%||===============================================================|90%||================================================================|91%||================================================================|92%||=================================================================|93%||==================================================================|94%||==================================================================|95%||===================================================================|96%||====================================================================|97%||=====================================================================|98%||=====================================================================|99%||======================================================================|100%#> Calculating importance metrics for attribute-level: c2#>|||0%||=|1%||=|2%||==|3%||===|4%||====|5%||====|6%||=====|7%||======|8%||======|9%||=======|10%||========|11%||========|12%||=========|13%||==========|14%||==========|15%||===========|16%||============|17%||=============|18%||=============|19%||==============|20%||===============|21%||===============|22%||================|23%||=================|24%||==================|25%||==================|26%||===================|27%||====================|28%||====================|29%||=====================|30%||======================|31%||======================|32%||=======================|33%||========================|34%||========================|35%||=========================|36%||==========================|37%||===========================|38%||===========================|39%||============================|40%||=============================|41%||=============================|42%||==============================|43%||===============================|44%||================================|45%||================================|46%||=================================|47%||==================================|48%||==================================|49%||===================================|50%||====================================|51%||====================================|52%||=====================================|53%||======================================|54%||======================================|55%||=======================================|56%||========================================|57%||=========================================|58%||=========================================|59%||==========================================|60%||===========================================|61%||===========================================|62%||============================================|63%||=============================================|64%||==============================================|65%||==============================================|66%||===============================================|67%||================================================|68%||================================================|69%||=================================================|70%||==================================================|71%||==================================================|72%||===================================================|73%||====================================================|74%||====================================================|75%||=====================================================|76%||======================================================|77%||=======================================================|78%||=======================================================|79%||========================================================|80%||=========================================================|81%||=========================================================|82%||==========================================================|83%||===========================================================|84%||============================================================|85%||============================================================|86%||=============================================================|87%||==============================================================|88%||==============================================================|89%||===============================================================|90%||================================================================|91%||================================================================|92%||=================================================================|93%||==================================================================|94%||==================================================================|95%||===================================================================|96%||====================================================================|97%||=====================================================================|98%||=====================================================================|99%||======================================================================|100%#> Calculating importance metrics for attribute-level: c3#>|||0%||=|1%||=|2%||==|3%||===|4%||====|5%||====|6%||=====|7%||======|8%||======|9%||=======|10%||========|11%||========|12%||=========|13%||==========|14%||==========|15%||===========|16%||============|17%||=============|18%||=============|19%||==============|20%||===============|21%||===============|22%||================|23%||=================|24%||==================|25%||==================|26%||===================|27%||====================|28%||====================|29%||=====================|30%||======================|31%||======================|32%||=======================|33%||========================|34%||========================|35%||=========================|36%||==========================|37%||===========================|38%||===========================|39%||============================|40%||=============================|41%||=============================|42%||==============================|43%||===============================|44%||================================|45%||================================|46%||=================================|47%||==================================|48%||==================================|49%||===================================|50%||====================================|51%||====================================|52%||=====================================|53%||======================================|54%||======================================|55%||=======================================|56%||========================================|57%||=========================================|58%||=========================================|59%||==========================================|60%||===========================================|61%||===========================================|62%||============================================|63%||=============================================|64%||==============================================|65%||==============================================|66%||===============================================|67%||================================================|68%||================================================|69%||=================================================|70%||==================================================|71%||==================================================|72%||===================================================|73%||====================================================|74%||====================================================|75%||=====================================================|76%||======================================================|77%||=======================================================|78%||=======================================================|79%||========================================================|80%||=========================================================|81%||=========================================================|82%||==========================================================|83%||===========================================================|84%||============================================================|85%||============================================================|86%||=============================================================|87%||==============================================================|88%||==============================================================|89%||===============================================================|90%||================================================================|91%||================================================================|92%||=================================================================|93%||==================================================================|94%||==================================================================|95%||===================================================================|96%||====================================================================|97%||=====================================================================|98%||=====================================================================|99%||======================================================================|100%#> Calculating importance metrics for attribute-level: d3#>|||0%||=|1%||=|2%||==|3%||===|4%||====|5%||====|6%||=====|7%||======|8%||======|9%||=======|10%||========|11%||========|12%||=========|13%||==========|14%||==========|15%||===========|16%||============|17%||=============|18%||=============|19%||==============|20%||===============|21%||===============|22%||================|23%||=================|24%||==================|25%||==================|26%||===================|27%||====================|28%||====================|29%||=====================|30%||======================|31%||======================|32%||=======================|33%||========================|34%||========================|35%||=========================|36%||==========================|37%||===========================|38%||===========================|39%||============================|40%||=============================|41%||=============================|42%||==============================|43%||===============================|44%||================================|45%||================================|46%||=================================|47%||==================================|48%||==================================|49%||===================================|50%||====================================|51%||====================================|52%||=====================================|53%||======================================|54%||======================================|55%||=======================================|56%||========================================|57%||=========================================|58%||=========================================|59%||==========================================|60%||===========================================|61%||===========================================|62%||============================================|63%||=============================================|64%||==============================================|65%||==============================================|66%||===============================================|67%||================================================|68%||================================================|69%||=================================================|70%||==================================================|71%||==================================================|72%||===================================================|73%||====================================================|74%||====================================================|75%||=====================================================|76%||======================================================|77%||=======================================================|78%||=======================================================|79%||========================================================|80%||=========================================================|81%||=========================================================|82%||==========================================================|83%||===========================================================|84%||============================================================|85%||============================================================|86%||=============================================================|87%||==============================================================|88%||==============================================================|89%||===============================================================|90%||================================================================|91%||================================================================|92%||=================================================================|93%||==================================================================|94%||==================================================================|95%||===================================================================|96%||====================================================================|97%||=====================================================================|98%||=====================================================================|99%||======================================================================|100%#> Calculating importance metrics for attribute-level: d2#>|||0%||=|1%||=|2%||==|3%||===|4%||====|5%||====|6%||=====|7%||======|8%||======|9%||=======|10%||========|11%||========|12%||=========|13%||==========|14%||==========|15%||===========|16%||============|17%||=============|18%||=============|19%||==============|20%||===============|21%||===============|22%||================|23%||=================|24%||==================|25%||==================|26%||===================|27%||====================|28%||====================|29%||=====================|30%||======================|31%||======================|32%||=======================|33%||========================|34%||========================|35%||=========================|36%||==========================|37%||===========================|38%||===========================|39%||============================|40%||=============================|41%||=============================|42%||==============================|43%||===============================|44%||================================|45%||================================|46%||=================================|47%||==================================|48%||==================================|49%||===================================|50%||====================================|51%||====================================|52%||=====================================|53%||======================================|54%||======================================|55%||=======================================|56%||========================================|57%||=========================================|58%||=========================================|59%||==========================================|60%||===========================================|61%||===========================================|62%||============================================|63%||=============================================|64%||==============================================|65%||==============================================|66%||===============================================|67%||================================================|68%||================================================|69%||=================================================|70%||==================================================|71%||==================================================|72%||===================================================|73%||====================================================|74%||====================================================|75%||=====================================================|76%||======================================================|77%||=======================================================|78%||=======================================================|79%||========================================================|80%||=========================================================|81%||=========================================================|82%||==========================================================|83%||===========================================================|84%||============================================================|85%||============================================================|86%||=============================================================|87%||==============================================================|88%||==============================================================|89%||===============================================================|90%||================================================================|91%||================================================================|92%||=================================================================|93%||==================================================================|94%||==================================================================|95%||===================================================================|96%||====================================================================|97%||=====================================================================|98%||=====================================================================|99%||======================================================================|100%#> Calculating importance metrics for attribute-level: e2#>|||0%||=|1%||=|2%||==|3%||===|4%||====|5%||====|6%||=====|7%||======|8%||======|9%||=======|10%||========|11%||========|12%||=========|13%||==========|14%||==========|15%||===========|16%||============|17%||=============|18%||=============|19%||==============|20%||===============|21%||===============|22%||================|23%||=================|24%||==================|25%||==================|26%||===================|27%||====================|28%||====================|29%||=====================|30%||======================|31%||======================|32%||=======================|33%||========================|34%||========================|35%||=========================|36%||==========================|37%||===========================|38%||===========================|39%||============================|40%||=============================|41%||=============================|42%||==============================|43%||===============================|44%||================================|45%||================================|46%||=================================|47%||==================================|48%||==================================|49%||===================================|50%||====================================|51%||====================================|52%||=====================================|53%||======================================|54%||======================================|55%||=======================================|56%||========================================|57%||=========================================|58%||=========================================|59%||==========================================|60%||===========================================|61%||===========================================|62%||============================================|63%||=============================================|64%||==============================================|65%||==============================================|66%||===============================================|67%||================================================|68%||================================================|69%||=================================================|70%||==================================================|71%||==================================================|72%||===================================================|73%||====================================================|74%||====================================================|75%||=====================================================|76%||======================================================|77%||=======================================================|78%||=======================================================|79%||========================================================|80%||=========================================================|81%||=========================================================|82%||==========================================================|83%||===========================================================|84%||============================================================|85%||============================================================|86%||=============================================================|87%||==============================================================|88%||==============================================================|89%||===============================================================|90%||================================================================|91%||================================================================|92%||=================================================================|93%||==================================================================|94%||==================================================================|95%||===================================================================|96%||====================================================================|97%||=====================================================================|98%||=====================================================================|99%||======================================================================|100%#> Calculating importance metrics for attribute-level: e3#>|||0%||=|1%||=|2%||==|3%||===|4%||====|5%||====|6%||=====|7%||======|8%||======|9%||=======|10%||========|11%||========|12%||=========|13%||==========|14%||==========|15%||===========|16%||============|17%||=============|18%||=============|19%||==============|20%||===============|21%||===============|22%||================|23%||=================|24%||==================|25%||==================|26%||===================|27%||====================|28%||====================|29%||=====================|30%||======================|31%||======================|32%||=======================|33%||========================|34%||========================|35%||=========================|36%||==========================|37%||===========================|38%||===========================|39%||============================|40%||=============================|41%||=============================|42%||==============================|43%||===============================|44%||================================|45%||================================|46%||=================================|47%||==================================|48%||==================================|49%||===================================|50%||====================================|51%||====================================|52%||=====================================|53%||======================================|54%||======================================|55%||=======================================|56%||========================================|57%||=========================================|58%||=========================================|59%||==========================================|60%||===========================================|61%||===========================================|62%||============================================|63%||=============================================|64%||==============================================|65%||==============================================|66%||===============================================|67%||================================================|68%||================================================|69%||=================================================|70%||==================================================|71%||==================================================|72%||===================================================|73%||====================================================|74%||====================================================|75%||=====================================================|76%||======================================================|77%||=======================================================|78%||=======================================================|79%||========================================================|80%||=========================================================|81%||=========================================================|82%||==========================================================|83%||===========================================================|84%||============================================================|85%||============================================================|86%||=============================================================|87%||==============================================================|88%||==============================================================|89%||===============================================================|90%||================================================================|91%||================================================================|92%||=================================================================|93%||==================================================================|94%||==================================================================|95%||===================================================================|96%||====================================================================|97%||=====================================================================|98%||=====================================================================|99%||======================================================================|100%plot(vimp_estimates)Supplying a single attribute-level, the same plot function willdisplay the importance estimates with corresponding 95 percentconfidence intervals:
plot(vimp_estimates,att_levels ="d3")#> Plotting importance scores for single attribute-level (with 95 percent confidence intervals)Finally, it is possible to estimate population IMCEs (pIMCEs) usingpIMCE() This function requires a list of the marginalprobabilities for each attribute in the population of interest, and canonly be estimated for one attribute-level comparison at a time (due tothe computational requirements):
fake_marginals<-list()fake_marginals[["A"]]<-c("a1"=0.33,"a2"=0.33,"a3"=0.34)fake_marginals[["B"]]<-c("b1"=0.33,"b2"=0.33,"b3"=0.34)fake_marginals[["C"]]<-c("c1"=0.33,"c2"=0.33,"c3"=0.34)fake_marginals[["D"]]<-c("d1"=0.75,"d2"=0.2,"d3"=0.05)fake_marginals[["E"]]<-c("e1"=0.33,"e2"=0.33,"e3"=0.34)# Reduced number of covariate data for sake of speedfake_pimces<-pIMCE(covar_data = fake_data[fake_data$id1%in%1:3,c("id1","covar1","covar2")],model = cj_model,attribs =c("A","B","C","D","E"),l ="E",l_1 ="e2",l_0 ="e1",marginals = fake_marginals,method ="bayes",cores =1)#>Predicting covariate profile1/30Predicting covariate profile2/30Predicting covariate profile3/30Predicting covariate profile4/30Predicting covariate profile5/30Predicting covariate profile6/30Predicting covariate profile7/30Predicting covariate profile8/30Predicting covariate profile9/30Predicting covariate profile10/30Predicting covariate profile11/30Predicting covariate profile12/30Predicting covariate profile13/30Predicting covariate profile14/30Predicting covariate profile15/30Predicting covariate profile16/30Predicting covariate profile17/30Predicting covariate profile18/30Predicting covariate profile19/30Predicting covariate profile20/30Predicting covariate profile21/30Predicting covariate profile22/30Predicting covariate profile23/30Predicting covariate profile24/30Predicting covariate profile25/30Predicting covariate profile26/30Predicting covariate profile27/30Predicting covariate profile28/30Predicting covariate profile29/30Predicting covariate profile30/30head(fake_pimces)#> pIMCE pIMCE_lower pIMCE_upper covar1 covar2 id1#> 1 0.1524670 0.05641574 0.2633844 0.7810672 1 1#> 2 0.1524670 0.05641574 0.2633844 0.7810672 1 1#> 3 0.1524670 0.05641574 0.2633844 0.7810672 1 1#> 4 0.1524670 0.05641574 0.2633844 0.7810672 1 1#> 5 0.1524670 0.05641574 0.2633844 0.7810672 1 1#> 6 0.1616489 0.05775652 0.3250999 0.8160509 0 2