Skip to content
Snippets Groups Projects
Commit d053d915 authored by Cavallaro's avatar Cavallaro
Browse files

Create_tables

parent 1bb5187c
No related branches found
No related tags found
No related merge requests found
File added
dir.create("Tables/mxl")
# Manipulation check
texreg(l=list(ols_percentage_correct_A, ols_percentage_correct_control_A, ols_percentage_correct_C, ols_percentage_correct_control_C),
custom.model.names = c("Case A", "with Controls", "Case C", "with Controls"),
custom.coef.map = list("(Intercept)" = "Intercept", "as.factor(Treatment_A)Treated" = "Treated", "as.factor(Treatment_A)Vol_Treated" = "Vol. Treated",
"as.factor(Treatment_C)No Info 2" = "No Info 2", "as.factor(Treatment_C)No Video 1" = "No Video 1",
"as.factor(Treatment_C)No Video 2" = "No Video 2", "as.factor(Treatment_C)Video 1" = "Video 1",
"as.factor(Treatment_C)Video 2" = "Video 2", "Z_Mean_NR" = "NR-Index", "as.factor(Gender)2" = "Female",
"Age_mean" = "Age", "QFIncome" = "Income"), stars = c(0.01, 0.05, 0.1),
file="Tables/ols/manipulation.tex")
# Net interview time
texreg(l=list(ols_time_spent_A, ols_time_spent_control_A, ols_time_spent_C, ols_time_spent_control_C),
custom.model.names = c("Case A", "with Controls", "Case C", "with Controls"),
custom.coef.map = list("(Intercept)" = "Intercept", "as.factor(Treatment_A)Treated" = "Treated", "as.factor(Treatment_A)Vol_Treated" = "Vol. Treated",
"as.factor(Treatment_C)No Info 2" = "No Info 2", "as.factor(Treatment_C)No Video 1" = "No Video 1",
"as.factor(Treatment_C)No Video 2" = "No Video 2", "as.factor(Treatment_C)Video 1" = "Video 1",
"as.factor(Treatment_C)Video 2" = "Video 2", "Z_Mean_NR" = "NR-Index", "as.factor(Gender)2" = "Female",
"Age_mean" = "Age", "QFIncome" = "Income"), stars = c(0.01, 0.05, 0.1),
file="Tables/ols/interviewtime.tex")
# CC Time
texreg(l=list(ols_time_cc_A, ols_time_cc_control_A, ols_time_cc_C, ols_time_cc_control_C),
custom.model.names = c("Case A", "with Controls", "Case C", "with Controls"),
custom.coef.map = list("(Intercept)" = "Intercept", "as.factor(Treatment_A)Treated" = "Treated", "as.factor(Treatment_A)Vol_Treated" = "Vol. Treated",
"as.factor(Treatment_C)No Info 2" = "No Info 2", "as.factor(Treatment_C)No Video 1" = "No Video 1",
"as.factor(Treatment_C)No Video 2" = "No Video 2", "as.factor(Treatment_C)Video 1" = "Video 1",
"as.factor(Treatment_C)Video 2" = "Video 2", "Z_Mean_NR" = "NR-Index", "as.factor(Gender)2" = "Female",
"Age_mean" = "Age", "QFIncome" = "Income"), stars = c(0.01, 0.05, 0.1),
file="Tables/ols/cctime.tex")
# Consequentiality
texreg(l=list(conseq_model_A, conseq_model_control_A, conseq_model_C, conseq_model_control_C),
custom.model.names = c("Case A", "with Controls", "Case C", "with Controls"),
custom.coef.map = list("(Intercept)" = "Intercept", "as.factor(Treatment_A)Treated" = "Treated", "as.factor(Treatment_A)Vol_Treated" = "Vol. Treated",
"as.factor(Treatment_C)No Info 2" = "No Info 2", "as.factor(Treatment_C)No Video 1" = "No Video 1",
"as.factor(Treatment_C)No Video 2" = "No Video 2", "as.factor(Treatment_C)Video 1" = "Video 1",
"as.factor(Treatment_C)Video 2" = "Video 2", "Z_Mean_NR" = "NR-Index", "as.factor(Gender)2" = "Female",
"Age_mean" = "Age", "QFIncome" = "Income"), stars = c(0.01, 0.05, 0.1),
file="Tables/ols/consequentiality.tex")
# Opt Out
texreg(l=list(ols_opt_out_A, ols_opt_out_control_A, ols_opt_out_C, ols_opt_out_control_C),
custom.model.names = c("Case A", "with Controls", "Case C", "with Controls"),
custom.coef.map = list("(Intercept)" = "Intercept", "as.factor(Treatment_A)Treated" = "Treated", "as.factor(Treatment_A)Vol_Treated" = "Vol. Treated",
"as.factor(Treatment_C)No Info 2" = "No Info 2", "as.factor(Treatment_C)No Video 1" = "No Video 1",
"as.factor(Treatment_C)No Video 2" = "No Video 2", "as.factor(Treatment_C)Video 1" = "Video 1",
"as.factor(Treatment_C)Video 2" = "Video 2", "Z_Mean_NR" = "NR-Index", "as.factor(Gender)2" = "Female",
"Age_mean" = "Age", "QFIncome" = "Income"), stars = c(0.01, 0.05, 0.1),
file="Tables/ols/optout.tex")
# Main model
texreg(l=list(mxl_wtp_case_a_rentINT),
custom.coef.map = list("mu_natural" = "Naturalness", "mu_walking" = "Walking Distance", "mu_rent" = "Rent",
"ASC_sq" = "ASC SQ", "sig_natural" = "Naturalness SD", "sig_walking" = "Walking Distance SD",
"sig_rent" = "Rent SD", "sig_ASC_sq" = "ASC SD",
"mu_nat_T" = "Naturalness X Treated", "mu_wd_T" = "Walking Distance X Treated", "mu_rent_T" = "Rent X Treated",
"mu_asc_T" = "ASC X Treated", "mu_nat_VT" = "Naturalness X Vol. Treated", "mu_wd_VT" = "Walking Distance X Vol. Treated",
"mu_rent_VT" = "Rent X Vol. Treated", "mu_asc_VT" = "ASC X Vol. Treated"),
stars = c(0.01, 0.05, 0.1), override.se = mxl_wtp_case_a_rentINT$robse, file="Tables/mxl/case_A_rent_INT.tex")
......@@ -6,12 +6,12 @@ database_full <- database_full %>% rename(Gender = "Q03W123", Education = "Q06W1
Conseq_Money = "Q29W3")
database_full <- database_full %>% mutate(Gender = recode(Gender, "A1" = 1, "A2" = 2, "A3"=3),
Education = recode(Education, "A1" = 1, "A2" = 2, "A3"=3, "A4" = 4, "A5" = 5),
Employment_type = recode(Employment_type, "A1" = 1, "A2" = 2, "A3"=3, "A4" = 4,
database_full <- database_full %>% mutate(Gender = dplyr::recode(Gender, "A1" = 1, "A2" = 2, "A3"=3),
Education = dplyr::recode(Education, "A1" = 1, "A2" = 2, "A3"=3, "A4" = 4, "A5" = 5),
Employment_type = dplyr::recode(Employment_type, "A1" = 1, "A2" = 2, "A3"=3, "A4" = 4,
"A5" = 5, "A6" = 6),
Conseq_UGS = recode(Conseq_UGS, "A1" = 5, "A2" = 4, "A3"=3, "A4" = 2, "A5" = 1, "A6" = NA_real_),
Conseq_Money = recode(Conseq_Money, "A1" = 5, "A2" = 4, "A3"=3, "A4" = 2, "A5" = 1, "A6" = NA_real_))
Conseq_UGS = dplyr::recode(Conseq_UGS, "A1" = 5, "A2" = 4, "A3"=3, "A4" = 2, "A5" = 1, "A6" = NA_real_),
Conseq_Money = dplyr::recode(Conseq_Money, "A1" = 5, "A2" = 4, "A3"=3, "A4" = 2, "A5" = 1, "A6" = NA_real_))
database_full <- database_full %>% mutate(Gender_female = case_when(Gender == 2 ~1, TRUE~0),
Age = 2023-Birthyear,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment