Skip to content
Snippets Groups Projects
Commit fb935cc6 authored by nc71qaxa's avatar nc71qaxa
Browse files

Conseq+präsi update

parent 69c75fcb
Branches
No related tags found
No related merge requests found
......@@ -6,6 +6,8 @@ library(reshape2)
library(xtable)
library(stargazer)
library(texreg)
# Set values
n_draws <- 2000
n_cores <- 1
......@@ -27,11 +29,15 @@ source("Scripts/ols/ols_time_spent.R")
source("Scripts/ols/ols_quiz.R")
source("Scripts/ols/ols_opt_out.R")
source("Scripts/ols/ols_nr.R")
source("Scripts/ols/ols_consequentiality.R")
##### Conditional Logits #####
#source("Scripts/clogit.R")
#source("Scripts/clogit_wtp.R")
##### Mixed Logit Models ######
#source("Scripts/mxl/mxl_wtp_space.R")
#source("Scripts/mxl/mxl_wtp_space_4d.R")
#source("Scripts/mxl/mxl_wtp_space_interact_all.R")
......@@ -67,6 +73,12 @@ mxl_wtp_case_a_prot <- apollo_loadModel("Estimation_results/mxl/without_proteste
mxl_wtp_case_b_prot <- apollo_loadModel("Estimation_results/mxl/without_protesters/MXL_wtp Case B prot")
mxl_wtp_case_c_prot <- apollo_loadModel("Estimation_results/mxl/without_protesters/MXL_wtp_Case_C prot")
# rent interactions models
mxl_wtp_case_a_rentINT <- apollo_loadModel("Estimation_results/mxl/MXL_wtp Case A Rent Int")
mxl_wtp_case_b_rentINT <- apollo_loadModel("Estimation_results/mxl/MXL_wtp Case B Rent Int")
mxl_wtp_case_c_rentINT <- apollo_loadModel("Estimation_results/mxl/MXL_wtp_Case_C Rent INT")
##############################
......
......@@ -2,13 +2,16 @@
database_full <- database_full %>% rename(Gender = "Q03W123", Education = "Q06W123", HHSize = "Q41W123",
WorkingTime = "Q44W123", Birthyear = "Q01W123", Rent_net = "Q07W123",
Number_Kids = "Q42W123", Employment_type = "Q43W123")
Number_Kids = "Q42W123", Employment_type = "Q43W123", Conseq_UGS = "Q28W3",
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,
"A5" = 5, "A6" = 6))
"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_))
database_full <- database_full %>% mutate(Gender_female = case_when(Gender == 2 ~1, TRUE~0),
Age = 2023-Birthyear,
......
......@@ -26,12 +26,12 @@ table(data$Choice_Treat)
logit_choice_treat<-glm(Choice_Treat ~ as.factor(Gender)+Z_Mean_NR+Age_mean +
logit_choice_treat<-glm(Choice_Treat ~ as.factor(Gender)+Z_Mean_NR+Age_mean + QFIncome +
as.factor(Education), data, family=binomial)
summary(logit_choice_treat)
logit_choice_treat_uni<-glm(Choice_Treat ~ as.factor(Gender)+Z_Mean_NR+Age_mean +
logit_choice_treat_uni<-glm(Choice_Treat ~ as.factor(Gender)+Z_Mean_NR+Age_mean + QFIncome +
Uni_degree , data, family=binomial)
summary(logit_choice_treat_uni)
......
......@@ -27,11 +27,11 @@ table(data$Choice_Prot)
logit_choice_prot<-glm(Choice_Prot ~ Gender_female +Z_Mean_NR+Age_mean +
logit_choice_prot<-glm(Choice_Prot ~ Gender_female +Z_Mean_NR+Age_mean + QFIncome +
Uni_degree, data, family=binomial)
summary(logit_choice_prot)
logit_choice_prot_tr<-glm(Choice_Prot ~ Gender_female +Z_Mean_NR+Age_mean +
logit_choice_prot_tr<-glm(Choice_Prot ~ Gender_female +Z_Mean_NR+Age_mean + QFIncome +
Uni_degree + as.factor(Treatment_A) + Naturalness_SQ + WalkingDistance_SQ +
Rent_SQ, data, family=binomial)
summary(logit_choice_prot_tr)
......@@ -47,7 +47,7 @@ data$Treatment_C <- as.factor(data$Treatment_C)
data$Treatment_C <- relevel(data$Treatment_C, ref = "No Treatment 3")
logit_choice_prot_trC<-glm(Choice_Prot ~ Gender_female +Z_Mean_NR+Age_mean +
logit_choice_prot_trC<-glm(Choice_Prot ~ Gender_female +Z_Mean_NR+Age_mean + QFIncome +
Uni_degree + as.factor(Treatment_C) + Naturalness_SQ + WalkingDistance_SQ +
Rent_SQ, data, family=binomial)
summary(logit_choice_prot_trC)
......
# Q28W3
# Q29W3
# A1 I belive, A5 I don't belive; A6 i don't know
data <- data %>% mutate(Conseq_score = Conseq_UGS + Conseq_Money)
conseq_model_A <- lm(Conseq_score ~ as.factor(Treatment_A), data)
summary(conseq_model_A)
conseq_model_control_A <- lm(Conseq_score ~ as.factor(Treatment_A) + Z_Mean_NR + as.factor(Gender)+Age_mean+ QFIncome + as.factor(Education),data)
summary(conseq_model_control_A )
conseq_model_B <- lm(Conseq_score ~ as.factor(Treatment_B), data)
summary(conseq_model_B)
conseq_model_control_B <- lm(Conseq_score ~ as.factor(Treatment_B) + Z_Mean_NR + as.factor(Gender)+Age_mean+ QFIncome + as.factor(Education),data)
summary(conseq_model_control_B)
conseq_model_C <- lm(Conseq_score ~ as.factor(Treatment_C), data)
summary(conseq_model_C)
conseq_model_control_C <- lm(Conseq_score ~ as.factor(Treatment_C) + Z_Mean_NR + as.factor(Gender)+Age_mean+ QFIncome + as.factor(Education),data)
summary(conseq_model_control_C)
......@@ -20,3 +20,4 @@ nr_model_treat_A <- lm(Z_Mean_NR ~ Age_mean + Uni_degree + Kids_Dummy + Gender_f
summary(nr_model_treat_A)
vif(nr_model_treat)
......@@ -6,18 +6,20 @@ quiz_data$Treatment_C <- relevel(quiz_data$Treatment_C, ref = "No Treatment 3")
ols_percentage_correct_A<- lm( percentage_correct ~ as.factor(Treatment_A) ,quiz_data)
summary(ols_percentage_correct_A)
ols_percentage_correct_control_A<- lm( percentage_correct ~ as.factor(Treatment_A) + Z_Mean_NR + as.factor(Gender)+Age_mean+as.factor(Education),quiz_data)
ols_percentage_correct_control_A<- lm( percentage_correct ~ as.factor(Treatment_A) + Z_Mean_NR + as.factor(Gender)+Age_mean+ QFIncome + as.factor(Education),quiz_data)
summary(ols_percentage_correct_control_A)
ols_percentage_correct_B<- lm( percentage_correct ~ as.factor(Treatment_B) ,quiz_data)
summary(ols_percentage_correct_B)
ols_percentage_correct_control_B<- lm( percentage_correct ~ as.factor(Treatment_B) + Z_Mean_NR + as.factor(Gender)+Age_mean+as.factor(Education),quiz_data)
ols_percentage_correct_control_B<- lm( percentage_correct ~ as.factor(Treatment_B) + Z_Mean_NR + as.factor(Gender)+Age_mean+ QFIncome + as.factor(Education),quiz_data)
summary(ols_percentage_correct_control_B)
ols_percentage_correct_C<- lm( percentage_correct ~ as.factor(Treatment_C) ,quiz_data)
summary(ols_percentage_correct_C)
ols_percentage_correct_control_C<- lm( percentage_correct ~ as.factor(Treatment_C) + Z_Mean_NR + as.factor(Gender)+Age_mean+as.factor(Education),quiz_data)
ols_percentage_correct_control_C<- lm( percentage_correct ~ as.factor(Treatment_C) + Z_Mean_NR + as.factor(Gender)+Age_mean+ QFIncome + as.factor(Education),quiz_data)
summary(ols_percentage_correct_control_C)
vif(ols_percentage_correct_control_C)
#
# # Create an HTML results table with customized names and stars
......
library(car)
data <- database_full %>%
group_by(id) %>%
slice(1) %>%
ungroup()
data$Treatment_C <- as.factor(data$Treatment_C)
data$Treatment_C <- relevel(data$Treatment_C, ref = "No Treatment 3")
ols_time_spent_A<- lm( interviewtime_net_clean ~ as.factor(Treatment_A) ,data)
summary(ols_time_spent_A)
ols_time_spent_control_A<- lm( interviewtime_net_clean ~ as.factor(Treatment_A) + Z_Mean_NR + as.factor(Gender)+Age_mean+as.factor(Education),data)
ols_time_spent_control_A<- lm( interviewtime_net_clean ~ as.factor(Treatment_A) + Z_Mean_NR + as.factor(Gender)+Age_mean+ QFIncome + as.factor(Education),data)
summary(ols_time_spent_control_A)
ols_time_spent_B<- lm( interviewtime_net_clean ~ as.factor(Treatment_B) ,data)
summary(ols_time_spent_B)
ols_time_spent_control_B<- lm( interviewtime_net_clean ~ as.factor(Treatment_B) + Z_Mean_NR + as.factor(Gender)+Age_mean+as.factor(Education),data)
ols_time_spent_control_B<- lm( interviewtime_net_clean ~ as.factor(Treatment_B) + Z_Mean_NR + as.factor(Gender)+Age_mean + QFIncome +as.factor(Education),data)
summary(ols_time_spent_control_B)
ols_time_spent_C<- lm( interviewtime_net_clean ~ as.factor(Treatment_C) ,data)
summary(ols_time_spent_C)
ols_time_spent_control_C<- lm( interviewtime_net_clean ~ as.factor(Treatment_C) + Z_Mean_NR + as.factor(Gender)+Age_mean+as.factor(Education),data)
ols_time_spent_control_C<- lm( interviewtime_net_clean ~ as.factor(Treatment_C) + Z_Mean_NR + as.factor(Gender)+Age_mean+ QFIncome + as.factor(Education),data)
summary(ols_time_spent_control_C)
dir.create("Tables/ols/")
......@@ -26,16 +29,16 @@ texreg(ols_time_spent_control_C, "Tables/ols/time_spent_control_c.tex")
ols_time_cc_A<- lm( CC_time_mean_clean ~ as.factor(Treatment_A) ,data)
summary(ols_time_cc_A)
ols_time_cc_control_A<- lm( CC_time_mean_clean ~ as.factor(Treatment_A) + Z_Mean_NR + as.factor(Gender)+Age+as.factor(Education),data)
ols_time_cc_control_A<- lm( CC_time_mean_clean ~ as.factor(Treatment_A) + Z_Mean_NR + as.factor(Gender)+Age_mean + QFIncome +as.factor(Education),data)
summary(ols_time_cc_control_A)
ols_time_cc_B<- lm( CC_time_mean_clean ~ as.factor(Treatment_B) ,data)
summary(ols_time_cc_B)
ols_time_cc_control_B<- lm( CC_time_mean_clean ~ as.factor(Treatment_B) + Z_Mean_NR + as.factor(Gender)+Age+as.factor(Education),data)
ols_time_cc_control_B<- lm( CC_time_mean_clean ~ as.factor(Treatment_B) + Z_Mean_NR + as.factor(Gender)+Age_mean + QFIncome + as.factor(Education),data)
summary(ols_time_cc_control_B)
ols_time_cc_C<- lm( CC_time_mean_clean ~ as.factor(Treatment_C) ,data)
summary(ols_time_cc_C)
ols_time_cc_control_C<- lm( CC_time_mean_clean ~ as.factor(Treatment_C) + Z_Mean_NR + as.factor(Gender)+Age+as.factor(Education),data)
ols_time_cc_control_C<- lm( CC_time_mean_clean ~ as.factor(Treatment_C) + Z_Mean_NR + as.factor(Gender)+Age_mean + QFIncome +as.factor(Education),data)
summary(ols_time_cc_control_C)
# # Create an HTML results table with customized names and stars
# results_table_5 <- stargazer(
......
......@@ -52,7 +52,7 @@ library(apollo)
## Choice Card
![](images/Figure 2.PNG){width="300"}
![](images/Figure%202.PNG){width="300"}
## Treatment Groups
......@@ -76,6 +76,19 @@ library(apollo)
- H2:
## Methods
- OLS and Logit regressions
- Mixed logit model with interactions:
```{=tex}
\begin{equation}
U_i = -(\beta_{C_i} + \beta_{TreatC_i} \cdot v_{Treat}) \cdot (\beta_{X_i} \cdot v_{X_i} + \beta_{TreatX_i} \cdot v_{X_i} \cdot v_{Treat} - C_i) + \epsilon_i
\label{mxl_base}
\end{equation}
```
## Socio Demografics {.smaller}
::: {style="font-size: 50%;"}
......@@ -104,9 +117,7 @@ datatable(treatment_socio_C)
summary(nr_model_treat_A)
```
## Logit Regression I
## Logit Regression: Who choses treatment?
Characteristics of the voluntarily treated persons
......@@ -114,7 +125,7 @@ Characteristics of the voluntarily treated persons
summary(logit_choice_treat)
```
## Logit Regression II
## Logit Regression: "Protest voting"
Does treatment affect "protest" voting?
......@@ -404,6 +415,32 @@ summary(ols_opt_out_control_C)
```
:::
## OLS: Consequentiality
with controls
::: panel-tabset
### Group A
```{r}
summary(conseq_model_control_A)
```
### Group B
```{r}
summary(conseq_model_control_B)
```
### Group C
```{r}
summary(conseq_model_control_C)
```
:::
## MXL: Split Samples
```{r}
......@@ -423,19 +460,19 @@ ggplot(data=mxl_melt_info, aes(x=Coefficent, y=abs(value), fill=variable)) +
### Scenario A
```{r}
summary(mxl_wtp_case_a)
summary(mxl_wtp_case_a_rentINT)
```
### Scenario B
```{r}
summary(mxl_wtp_case_b)
summary(mxl_wtp_case_b_rentINT)
```
### Scenario C
```{r}
summary(mxl_wtp_case_c)
summary(mxl_wtp_case_c_rentINT)
```
:::
......@@ -467,7 +504,6 @@ summary(mxl_wtp_case_c_prot)
**Hypotheses:** Individuals with greater Nature Relatedness (NR) are more inclined to autonomously seek information about environmental subjects, such as the impact of urban green spaces on urban heat islands. Consequently, any observed increase in the willingness to pay among the treated group may be attributed to the individuals' higher NR rather than the treatment itself.
## MXL: WTP space
with NR index
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment