[5] | 1 | library (foreign)
|
---|
| 2 | library (ggplot2)
|
---|
| 3 | library (nlme)
|
---|
| 4 | library (lattice)
|
---|
| 5 | library (MASS)
|
---|
| 6 | library (Matrix)
|
---|
| 7 | library (lme4)
|
---|
| 8 | library (multilevel)
|
---|
| 9 | library (psy)
|
---|
| 10 | library(ordinal)
|
---|
| 11 | library(pspearman)
|
---|
| 12 | library(readxl)
|
---|
| 13 | library(car)
|
---|
| 14 |
|
---|
| 15 |
|
---|
| 16 | #REGION CRONBACH ALPHA ALLIANCE
|
---|
| 17 |
|
---|
| 18 | data_alliLSHM <- read_excel("PATH/Alliance dataLSHM.xlsx")
|
---|
| 19 | View(data_alliLSHM)
|
---|
| 20 | cronbach(data_alliLSHM)
|
---|
| 21 |
|
---|
| 22 | data_alliHSHM <- read_excel("PATH/Alliance dataHSHM.xlsx")
|
---|
| 23 | View(data_alliHSHM)
|
---|
| 24 | cronbach(data_alliHSHM)
|
---|
| 25 |
|
---|
| 26 | data_alliLSMM <- read_excel("PATH/Alliance dataLSMM.xlsx")
|
---|
| 27 | View(data_alliLSMM)
|
---|
| 28 | cronbach(data_alliLSMM)
|
---|
| 29 |
|
---|
| 30 | data_alliMSMM <- read_excel("PATH/Alliance dataMSMM.xlsx")
|
---|
| 31 | View(data_alliMSMM)
|
---|
| 32 | cronbach(data_alliMSMM)
|
---|
| 33 |
|
---|
| 34 | data_alliHSMM <- read_excel("PATH/Alliance dataHSMM.xlsx")
|
---|
| 35 | View(data_alliHSMM)
|
---|
| 36 | cronbach(data_alliHSMM)
|
---|
| 37 |
|
---|
| 38 | data_alliLSLM <- read_excel("PATH/Alliance dataLSLM.xlsx")
|
---|
| 39 | View(data_alliLSLM)
|
---|
| 40 | cronbach(data_alliLSLM)
|
---|
| 41 |
|
---|
| 42 | data_alliMSLM <- read_excel("PATH/Alliance dataMSLM.xlsx")
|
---|
| 43 | View(data_alliMSLM)
|
---|
| 44 | cronbach(data_alliMSLM)
|
---|
| 45 |
|
---|
| 46 | data_alliMSHM <- read_excel("PATH/Alliance dataMSHM.xlsx")
|
---|
| 47 | View(data_alliMSHM)
|
---|
| 48 | cronbach(data_alliMSHM)
|
---|
| 49 |
|
---|
| 50 | data_alliHSLM <- read_excel("PATH/Alliance dataHSLM.xlsx")
|
---|
| 51 | View(data_alliHSLM)
|
---|
| 52 | cronbach(data_alliHSLM)
|
---|
| 53 |
|
---|
| 54 |
|
---|
| 55 |
|
---|
| 56 | #Region Data analysis & Descriptive outcomes
|
---|
| 57 |
|
---|
| 58 | data <- read_excel("PATH/Datatable.xlsx")
|
---|
| 59 |
|
---|
| 60 | #Specify levels of MatchSys as 0 or 1
|
---|
| 61 | data$MatchSys = factor(data$MatchSys,levels=c(0,1))
|
---|
| 62 | #Specify levels for Route as Motiv, Accept or Refer
|
---|
| 63 | data$Route = factor(data$Route,levels=c("motivate","accept","refer"))
|
---|
| 64 |
|
---|
| 65 | #Specify levels for SubSev as Low, Med, High
|
---|
| 66 | data$SubSev = factor(data$SubSev,levels=c("Low","Med","High"))
|
---|
| 67 | data$SubSev <- ordered(data$SubSev)
|
---|
| 68 | #Specify levels of SubMoti as Low, Med, High
|
---|
| 69 | data$SubMoti = factor(data$SubMoti,levels=c("Low","Med","High"))
|
---|
| 70 | data$SubMoti <- ordered(data$SubMoti)
|
---|
| 71 |
|
---|
| 72 | #Specify levels for ScenSev as Low, Med, High
|
---|
| 73 | data$ScenSev = factor(data$ScenSev,levels=c("Low","Med","High"))
|
---|
| 74 | data$ScenSev <- ordered(data$ScenSev)
|
---|
| 75 | #Specify levels of ScenMoti as Low, Med, High
|
---|
| 76 | data$ScenMoti = factor(data$ScenMoti,levels=c("Low","Med","High"))
|
---|
| 77 | data$ScenMoti <- ordered(data$ScenMoti)
|
---|
| 78 |
|
---|
| 79 |
|
---|
| 80 | data$ScenSit = factor(data$ScenSit,levels=c("LsLm","MsLm","HsLm","LsMm","MsMm","HsMm","LsHm","MsHm","HsHm"))
|
---|
| 81 | data$SubSit = factor(data$SubSit,levels=c("LsLm","MsLm","HsLm","LsMm","MsMm","HsMm","LsHm","MsHm","HsHm"))
|
---|
| 82 |
|
---|
| 83 | data$WhyTxt = factor(data$WhyTxt,levels=c("Mon","Stig","Time"))
|
---|
| 84 |
|
---|
| 85 | data$ppCode = factor(data$ppCode)
|
---|
| 86 |
|
---|
| 87 | #Display data
|
---|
| 88 | View(data)
|
---|
| 89 |
|
---|
| 90 |
|
---|
| 91 | #EXPLORATION Graphs
|
---|
| 92 | ### data exploration
|
---|
| 93 | stem(data$FBH)
|
---|
| 94 | hist(data$FBH)
|
---|
| 95 |
|
---|
| 96 | ggplot(data, aes(x=Help, fill=MatchSys)) + geom_density(alpha = 0.3)
|
---|
| 97 | ggplot(data, aes(x=Help, fill=Route)) + geom_density(alpha = 0.3)
|
---|
| 98 |
|
---|
| 99 | ggplot(data, aes(x=Return, fill=MatchSys)) + geom_density(alpha = 0.3)
|
---|
| 100 | ggplot(data, aes(x=Return, fill=Route)) + geom_density(alpha = 0.3)
|
---|
| 101 |
|
---|
| 102 | ggplot(data, aes(x=FBH, fill=MatchSys)) + geom_density(alpha = 0.3)
|
---|
| 103 | ggplot(data, aes(x=FBH, fill=Route)) + geom_density(alpha = 0.3)
|
---|
| 104 | ggplot(data, aes(x=FBH, fill=Gen)) + geom_density(alpha = 0.3)
|
---|
| 105 |
|
---|
| 106 | #MEAN, 0 Modell revealing deviation from 0 & moti + severity added to check if these have an overall effect.
|
---|
| 107 | mean(data$Help)
|
---|
| 108 | sd(data$Help)
|
---|
| 109 | Model_null_h <- lme(fixed = Help~1, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 110 | summary(Model_null_h)
|
---|
| 111 | anova(Model_null_h)
|
---|
| 112 | Model_scen_h <- lme(fixed = Help~ScenSit, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 113 | anova(Model_null_h,Model_scen_h)
|
---|
| 114 | anova(Model_scen_h)
|
---|
| 115 |
|
---|
| 116 |
|
---|
| 117 | mean(data$Return)
|
---|
| 118 | sd(data$Return)
|
---|
| 119 | Model_null_r <- lme(fixed = Return~1, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 120 |
|
---|
| 121 | anova(Model_null_r)
|
---|
| 122 | Model_scen_r <- lme(fixed = Return~ScenSit, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 123 | anova(Model_null_r,Model_scen_r)
|
---|
| 124 | anova(Model_scen_r)
|
---|
| 125 |
|
---|
| 126 | mean(data$FBH)
|
---|
| 127 | sd(data$FBH)
|
---|
| 128 | Model_null_a <- lme(fixed = FBH~1, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 129 | anova(Model_null_a)
|
---|
| 130 | Model_scen_a <- lme(fixed = FBH~ScenSit, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 131 | summary(Model_scen_a)
|
---|
| 132 | anova(Model_null_a,Model_scen_a)
|
---|
| 133 |
|
---|
| 134 |
|
---|
| 135 | #REGION COMPARE ScenJECTIVE - SCENE SITUATION
|
---|
| 136 | fmodelSnull <- clmm2(ScenSev~1,random = ppCode,data=data,Hess=TRUE,nAGQ = 10)
|
---|
| 137 | summary(fmodelSnull)
|
---|
| 138 |
|
---|
| 139 | fmodelS <- clmm2(ScenSev ~ SubSev, random = ppCode, data=data, Hess=TRUE,nAGQ = 10)
|
---|
| 140 | summary(fmodelS)
|
---|
| 141 | anova(fmodelSnull,fmodelS)
|
---|
| 142 |
|
---|
| 143 | ( McF.pR2 <- 1 - fmodelS$logLik/fmodelSnull$logLik )
|
---|
| 144 |
|
---|
| 145 |
|
---|
| 146 | fmodelMnull <- clmm2(ScenMoti~1,random = ppCode,data=data,Hess=TRUE,nAGQ = 10)
|
---|
| 147 | summary(fmodelMnull)
|
---|
| 148 | fmodelM <- clmm2(SubMoti ~ ScenMoti , random = ppCode,data=data,Hess=TRUE,nAGQ = 10)
|
---|
| 149 | summary(fmodelM)
|
---|
| 150 | anova(fmodelMnull,fmodelM)
|
---|
| 151 |
|
---|
| 152 | ( McF.pR2 <- 1 - fmodelM$logLik/fmodelMnull$logLik )
|
---|
| 153 |
|
---|
| 154 |
|
---|
| 155 |
|
---|
| 156 |
|
---|
| 157 |
|
---|
| 158 |
|
---|
| 159 | #Covariate checks
|
---|
| 160 | Model_age_h <- lme(fixed = Help~Age, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 161 | anova(Model_null_h,Model_age_h)
|
---|
| 162 | Model_age_r <- lme(fixed = Return~Age, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 163 | anova(Model_null_r,Model_age_r)
|
---|
| 164 | Model_age_a <- lme(fixed = FBH~Age, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 165 | anova(Model_null_a,Model_age_a)
|
---|
| 166 |
|
---|
| 167 | Model_gen_h <- lme(fixed = Help~Gen, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 168 | anova(Model_null_h,Model_gen_h)
|
---|
| 169 | Model_gen_r <- lme(fixed = Return~Gen, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 170 | anova(Model_null_r,Model_gen_r)
|
---|
| 171 | Model_gen_a <- lme(fixed = FBH~Gen, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 172 | summary(Model_gen_a)
|
---|
| 173 | anova(Model_null_a,Model_gen_a)
|
---|
| 174 | anova(Model_gen_a)
|
---|
| 175 |
|
---|
| 176 | Model_isi_h <- lme(fixed = Help~ISITot, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 177 | anova(Model_null_h,Model_isi_h)
|
---|
| 178 | Model_isi_r <- lme(fixed = Return~ISITot, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 179 | anova(Model_null_r,Model_isi_r)
|
---|
| 180 | Model_isi_a <- lme(fixed = FBH~ISITot, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 181 | anova(Model_null_a,Model_isi_a)
|
---|
| 182 |
|
---|
| 183 | Model_why_h <- lme(fixed = Help~WhyTxt, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 184 | anova(Model_null_h,Model_why_h)
|
---|
| 185 | Model_why_r <- lme(fixed = Return~WhyTxt, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 186 | anova(Model_null_r,Model_why_r)
|
---|
| 187 | Model_why_a <- lme(fixed = FBH~WhyTxt, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 188 | anova(Model_null_a,Model_why_a)
|
---|
| 189 |
|
---|
| 190 | #Best Route generally
|
---|
| 191 | Model_route_h <- lme(fixed = Help~Route, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 192 | summary(Model_route_h)
|
---|
| 193 | anova(Model_null_h,Model_route_h)
|
---|
| 194 | anova(Model_route_h)
|
---|
| 195 | Model_route_r <- lme(fixed = Return~Route, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 196 | summary(Model_route_r)
|
---|
| 197 | anova(Model_null_r,Model_route_r)
|
---|
| 198 | anova(Model_route_r)
|
---|
| 199 | Model_route_a <- lme(fixed = FBH~Route, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 200 | summary(Model_route_a)
|
---|
| 201 | anova(Model_null_a,Model_route_a)
|
---|
| 202 | anova(Model_route_a)
|
---|
| 203 |
|
---|
| 204 |
|
---|
| 205 | ggplot(data, aes(x=Route, y=FBH)) + geom_density(alpha = 0.3)
|
---|
| 206 | qplot(x=Route, y=FBH,data=data, geom="bar")
|
---|
| 207 |
|
---|
| 208 |
|
---|
| 209 | #HYPOTHESIS1
|
---|
| 210 |
|
---|
| 211 | data2 <-subset(data, (Route == "accept"| Route == "refer"))
|
---|
| 212 | View(data2)
|
---|
| 213 |
|
---|
| 214 |
|
---|
| 215 | ModelH1_0 <- lme(fixed = Help~1, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 216 | summary(ModelH1_0)
|
---|
| 217 |
|
---|
| 218 | ModelH1_1 <- lme(fixed = Help~ScenSit, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 219 | summary(ModelH1_1)
|
---|
| 220 | anova(ModelH1_0,ModelH1_1)
|
---|
| 221 |
|
---|
| 222 | ModelH1_2 <- lme(fixed = Help~Route, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 223 | summary(ModelH1_2)
|
---|
| 224 | anova(ModelH1_0,ModelH1_2)
|
---|
| 225 |
|
---|
| 226 | ModelH1_3 <- lme(fixed = Help~Route+ScenSit, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 227 | ModelH1_4 <- lme(fixed = Help~Route+ScenSit+Route:ScenSit, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 228 | summary(ModelH1_4)
|
---|
| 229 | anova(ModelH1_3,ModelH1_4)
|
---|
| 230 |
|
---|
| 231 | ModelH1_3 <- lme(fixed = Help~Route+ScenSit, random = ~1 | ppCode, data = data2, method = "ML")
|
---|
| 232 | ModelH1_4 <- lme(fixed = Help~Route+ScenSit+Route:ScenSit, random = ~1 | ppCode, data = data2, method = "ML")
|
---|
| 233 | summary(ModelH1_4)
|
---|
| 234 | anova(ModelH1_3,ModelH1_4)
|
---|
| 235 |
|
---|
| 236 |
|
---|
| 237 | ModelH1_0 <- lme(fixed = Return~1, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 238 | summary(ModelH1_0)
|
---|
| 239 |
|
---|
| 240 | ModelH1_1 <- lme(fixed = Return~ScenSit, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 241 | summary(ModelH1_1)
|
---|
| 242 | anova(ModelH1_0,ModelH1_1)
|
---|
| 243 |
|
---|
| 244 | ModelH1_2 <- lme(fixed = Return~Route, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 245 | summary(ModelH1_2)
|
---|
| 246 | anova(ModelH1_0,ModelH1_2)
|
---|
| 247 |
|
---|
| 248 | ModelH1_3 <- lme(fixed = Return~Route+ScenSit, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 249 | ModelH1_4 <- lme(fixed = Return~Route+ScenSit+Route:ScenSit, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 250 | summary(ModelH1_4)
|
---|
| 251 | anova(ModelH1_3,ModelH1_4)
|
---|
| 252 |
|
---|
| 253 | ModelH1_3 <- lme(fixed = Return~Route+ScenSit, random = ~1 | ppCode, data = data2, method = "ML")
|
---|
| 254 | ModelH1_4 <- lme(fixed = Return~Route+ScenSit+Route:ScenSit, random = ~1 | ppCode, data = data2, method = "ML")
|
---|
| 255 | summary(ModelH1_4)
|
---|
| 256 | anova(ModelH1_3,ModelH1_4)
|
---|
| 257 |
|
---|
| 258 |
|
---|
| 259 |
|
---|
| 260 | ModelH1_0 <- lme(fixed = FBH~1, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 261 | summary(ModelH1_0)
|
---|
| 262 |
|
---|
| 263 | ModelH1_1 <- lme(fixed = FBH~ScenSit, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 264 | summary(ModelH1_1)
|
---|
| 265 | anova(ModelH1_0,ModelH1_1)
|
---|
| 266 |
|
---|
| 267 | ModelH1_2 <- lme(fixed = FBH~Route, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 268 | summary(ModelH1_2)
|
---|
| 269 | anova(ModelH1_0,ModelH1_2)
|
---|
| 270 |
|
---|
| 271 | ModelH1_3 <- lme(fixed = FBH~Route+ScenSit, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 272 | ModelH1_4 <- lme(fixed = FBH~Route+ScenSit+Route:ScenSit, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 273 | summary(ModelH1_4)
|
---|
| 274 | anova(ModelH1_3,ModelH1_4)
|
---|
| 275 |
|
---|
| 276 | ModelH1_3 <- lme(fixed = FBH~Route+ScenSit, random = ~1 | ppCode, data = data2, method = "ML")
|
---|
| 277 | ModelH1_4 <- lme(fixed = FBH~Route+ScenSit+Route:ScenSit, random = ~1 | ppCode, data = data2, method = "ML")
|
---|
| 278 | summary(ModelH1_4)
|
---|
| 279 | anova(ModelH1_3,ModelH1_4)
|
---|
| 280 |
|
---|
| 281 |
|
---|
| 282 | #HYPOTHESIS2
|
---|
| 283 | dataH2 <- subset(data, (Systemroute == "motivate"))
|
---|
| 284 | #View(dataH2)
|
---|
| 285 |
|
---|
| 286 | ModelH2_0 <- lme(fixed = Help~1, random = ~1 | ppCode, data = dataH2, method = "ML")
|
---|
| 287 | summary(ModelH2_0)
|
---|
| 288 |
|
---|
| 289 | ModelH2_1 <- lme(fixed = Help~Route, random = ~1 | ppCode, data = dataH2, method = "ML")
|
---|
| 290 | summary(ModelH2_1)
|
---|
| 291 | anova(ModelH2_0,ModelH2_1)
|
---|
| 292 |
|
---|
| 293 | dataH2B <- subset(dataH2, (Route == "motivate" | Route == "refer"))
|
---|
| 294 |
|
---|
| 295 | ModelH2_0B <- lme(fixed = Help~1, random = ~1 | ppCode, data = dataH2B, method = "ML")
|
---|
| 296 | summary(ModelH2_0B)
|
---|
| 297 |
|
---|
| 298 | ModelH2_1B <- lme(fixed = Help~Route, random = ~1 | ppCode, data = dataH2B, method = "ML")
|
---|
| 299 | summary(ModelH2_1B)
|
---|
| 300 | anova(ModelH2_0B,ModelH2_1B)
|
---|
| 301 |
|
---|
| 302 | dataH2C <- subset(dataH2, (Route == "motivate" | Route == "accept"))
|
---|
| 303 |
|
---|
| 304 | ModelH2_0C <- lme(fixed = Help~1, random = ~1 | ppCode, data = dataH2C, method = "ML")
|
---|
| 305 | summary(ModelH2_0C)
|
---|
| 306 |
|
---|
| 307 | ModelH2_1C <- lme(fixed = Help~Route, random = ~1 | ppCode, data = dataH2C, method = "ML")
|
---|
| 308 | summary(ModelH2_1C)
|
---|
| 309 | anova(ModelH2_0C,ModelH2_1C)
|
---|
| 310 |
|
---|
| 311 |
|
---|
| 312 | #HYPOTHESIS3
|
---|
| 313 | dataH3 <- subset(data, (Systemroute == "refer" | Route == "refer"))
|
---|
| 314 |
|
---|
| 315 | ModelH3_0 <- lme(fixed = Help~1, random = ~1 | ppCode, data = dataH3, method = "ML")
|
---|
| 316 | summary(ModelH3_0)
|
---|
| 317 | anova(ModelH3_0)
|
---|
| 318 |
|
---|
| 319 | #HYPOTHESIS4
|
---|
| 320 | dataH4 <- subset(data, (Systemroute == "accept"))
|
---|
| 321 |
|
---|
| 322 | ModelH4_0R <- lme(fixed = Return~1, random = ~1 | ppCode, data = dataH4, method = "ML")
|
---|
| 323 | summary(ModelH4_0R)
|
---|
| 324 |
|
---|
| 325 | ModelH4_1R <- lme(fixed = Return~Route, random = ~1 | ppCode, data = dataH4, method = "ML")
|
---|
| 326 | summary(ModelH4_1R)
|
---|
| 327 | anova(ModelH4_0R, ModelH4_1R)
|
---|
| 328 |
|
---|
| 329 | ModelH4_0A <- lme(fixed = FBH~1, random = ~1 | ppCode, data = dataH4, method = "ML")
|
---|
| 330 | summary(ModelH4_0A)
|
---|
| 331 |
|
---|
| 332 | ModelH4_1A <- lme(fixed = FBH~Route, random = ~1 | ppCode, data = dataH4, method = "ML")
|
---|
| 333 | summary(ModelH4_1A)
|
---|
| 334 | anova(ModelH4_0A, ModelH4_1A)
|
---|
| 335 |
|
---|
| 336 |
|
---|
| 337 |
|
---|
| 338 | dataH4B <- subset(dataH4, (Route == "accept" | Route == "motivate"))
|
---|
| 339 |
|
---|
| 340 | View(dataH4B)
|
---|
| 341 |
|
---|
| 342 | ModelH4_0RB <- lme(fixed = Return~1, random = ~1 | ppCode, data = dataH4B, method = "ML")
|
---|
| 343 | summary(ModelH4_0RB)
|
---|
| 344 |
|
---|
| 345 | ModelH4_1RB <- lme(fixed = Return~Route, random = ~1 | ppCode, data = dataH4B, method = "ML")
|
---|
| 346 | summary(ModelH4_1RB)
|
---|
| 347 | anova(ModelH4_0RB, ModelH4_1RB)
|
---|
| 348 |
|
---|
| 349 | ModelH4_0AB <- lme(fixed = FBH~1, random = ~1 | ppCode, data = dataH4B, method = "ML")
|
---|
| 350 | summary(ModelH4_0AB)
|
---|
| 351 |
|
---|
| 352 | ModelH4_1AB <- lme(fixed = FBH~Route, random = ~1 | ppCode, data = dataH4B, method = "ML")
|
---|
| 353 | summary(ModelH4_1AB)
|
---|
| 354 | anova(ModelH4_0AB, ModelH4_1AB)
|
---|
| 355 |
|
---|
| 356 |
|
---|
| 357 |
|
---|
| 358 | dataH4C <- subset(dataH4, (Route == "accept" | Route == "refer"))
|
---|
| 359 |
|
---|
| 360 |
|
---|
| 361 | ModelH4_0RC <- lme(fixed = Return~1, random = ~1 | ppCode, data = dataH4C, method = "ML")
|
---|
| 362 | summary(ModelH4_0RC)
|
---|
| 363 |
|
---|
| 364 | ModelH4_1RC <- lme(fixed = Return~Route, random = ~1 | ppCode, data = dataH4C, method = "ML")
|
---|
| 365 | summary(ModelH4_1RC)
|
---|
| 366 | anova(ModelH4_0RC, ModelH4_1RC)
|
---|
| 367 |
|
---|
| 368 | ModelH4_0AC <- lme(fixed = FBH~1, random = ~1 | ppCode, data = dataH4C, method = "ML")
|
---|
| 369 | summary(ModelH4_0AC)
|
---|
| 370 |
|
---|
| 371 | ModelH4_1AC <- lme(fixed = FBH~Route, random = ~1 | ppCode, data = dataH4C, method = "ML")
|
---|
| 372 | summary(ModelH4_1AC)
|
---|
| 373 | anova(ModelH4_0AC, ModelH4_1AC)
|
---|
| 374 |
|
---|
| 375 |
|
---|
| 376 | #PRIMARY OUTCOMES
|
---|
| 377 | #Comparison Motivation & System
|
---|
| 378 |
|
---|
| 379 | datacon <- read_excel("PATH/Data_conditionsSM.xlsx")
|
---|
| 380 | #View(datacon)
|
---|
| 381 |
|
---|
| 382 | #Specify levels of MatchSys as 0 or 1
|
---|
| 383 | datacon$MatchSys = factor(datacon$MatchSys,levels=c(0,1))
|
---|
| 384 | #Specify levels for Route as Motiv, Accept or Refer
|
---|
| 385 | datacon$Route = factor(datacon$Route,levels=c("motivate","accept","refer"))
|
---|
| 386 |
|
---|
| 387 | #Specify levels for SubSev as Low, Med, High
|
---|
| 388 | datacon$SubSev = factor(datacon$SubSev,levels=c("Low","Med","High"))
|
---|
| 389 | datacon$SubSev <- ordered(datacon$SubSev)
|
---|
| 390 | #Specify levels of SubMoti as Low, Med, High
|
---|
| 391 | datacon$SubMoti = factor(datacon$SubMoti,levels=c("Low","Med","High"))
|
---|
| 392 | datacon$SubMoti <- ordered(datacon$SubMoti)
|
---|
| 393 |
|
---|
| 394 | #Specify levels for ScenSev as Low, Med, High
|
---|
| 395 | datacon$ScenSev = factor(datacon$ScenSev,levels=c("Low","Med","High"))
|
---|
| 396 | datacon$ScenSev <- ordered(datacon$ScenSev)
|
---|
| 397 | #Specify levels of ScenMoti as Low, Med, High
|
---|
| 398 | datacon$ScenMoti = factor(datacon$ScenMoti,levels=c("Low","Med","High"))
|
---|
| 399 | datacon$ScenMoti <- ordered(datacon$ScenMoti)
|
---|
| 400 |
|
---|
| 401 | datacon$Condition = factor(datacon$Condition,levels=c("motivate","system"))
|
---|
| 402 | datacon$ppCode = factor(datacon$ppCode)
|
---|
| 403 |
|
---|
| 404 | #HELP
|
---|
| 405 | Modelc_h <- lme(fixed = Help~1, random = ~1 | ppCode, data = datacon, method = "ML")
|
---|
| 406 | summary(Modelc_h)
|
---|
| 407 |
|
---|
| 408 | ggplot(datacon, aes(x=Help, fill=Condition)) + geom_density(alpha = 0.3)
|
---|
| 409 |
|
---|
| 410 | #Model effect of Condition on Help
|
---|
| 411 | Modelc_hCon <- lme(fixed = Help~Condition, random = ~1 | ppCode, data = datacon, method = "ML")
|
---|
| 412 | summary(Modelc_hCon)
|
---|
| 413 | #Vergelijk of model MatchSys_aa beter 'MatchSys' heeft dan model test. Lagere logLik is betere MatchSys
|
---|
| 414 | anova(Modelc_h,Modelc_hCon)
|
---|
| 415 | anova(Modelc_hCon)
|
---|
| 416 |
|
---|
| 417 | #Return
|
---|
| 418 | Modelc_r <- lme(fixed = Return~1, random = ~1 | ppCode, data = datacon, method = "ML")
|
---|
| 419 | summary(Modelc_r)
|
---|
| 420 |
|
---|
| 421 | ggplot(datacon, aes(x=Return, fill=Condition)) + geom_density(alpha = 0.3)
|
---|
| 422 |
|
---|
| 423 | #Model effect of Condition on Return
|
---|
| 424 | Modelc_rCon <- lme(fixed = Return~Condition, random = ~1 | ppCode, data = datacon, method = "ML")
|
---|
| 425 | summary(Modelc_rCon)
|
---|
| 426 | #Vergelijk of model MatchSys_aa beter 'MatchSys' heeft dan model test. Lagere logLik is betere MatchSys
|
---|
| 427 | anova(Modelc_r,Modelc_rCon)
|
---|
| 428 | anova(Modelc_rCon)
|
---|
| 429 |
|
---|
| 430 | #ALLI
|
---|
| 431 | Modelc_a <- lme(fixed = FBH~1, random = ~1 | ppCode, data = datacon, method = "ML")
|
---|
| 432 | summary(Modelc_a)
|
---|
| 433 |
|
---|
| 434 | ggplot(datacon, aes(x=FBH, fill=Condition)) + geom_density(alpha = 0.3)
|
---|
| 435 |
|
---|
| 436 | #Model effect of Condition on FBH
|
---|
| 437 | Modelc_aCon <- lme(fixed = FBH~Condition, random = ~1 | ppCode, data = datacon, method = "ML")
|
---|
| 438 | summary(Modelc_aCon)
|
---|
| 439 | #Vergelijk of model MatchSys_aa beter 'MatchSys' heeft dan model test. Lagere logLik is betere MatchSys
|
---|
| 440 | anova(Modelc_a,Modelc_aCon)
|
---|
| 441 | anova(Modelc_aCon)
|
---|
| 442 |
|
---|
| 443 | #Model effect of Condition on FBH
|
---|
| 444 | Modelc_aConGen <- lme(fixed = FBH~Condition+Gen, random = ~1 | ppCode, data = datacon, method = "ML")
|
---|
| 445 | summary(Modelc_aConGen)
|
---|
| 446 | #Vergelijk of model MatchSys_aa beter 'MatchSys' heeft dan model test. Lagere logLik is betere MatchSys
|
---|
| 447 | anova(Modelc_aCon,Modelc_aConGen)
|
---|
| 448 |
|
---|
| 449 |
|
---|
| 450 |
|
---|
| 451 | #Comparison per Accept & Rever route
|
---|
| 452 | #Accept
|
---|
| 453 | dataconA <- read_excel("PATH/Data_conditionsSMaccept.xlsx")
|
---|
| 454 | #View(datacon)
|
---|
| 455 |
|
---|
| 456 | #Specify levels of MatchSys as 0 or 1
|
---|
| 457 | dataconA$MatchSys = factor(dataconA$MatchSys,levels=c(0,1))
|
---|
| 458 | #Specify levels for Route as Motiv, Accept or Refer
|
---|
| 459 | dataconA$Route = factor(dataconA$Route,levels=c("motivate","accept","refer"))
|
---|
| 460 |
|
---|
| 461 | #Specify levels for SubSev as Low, Med, High
|
---|
| 462 | dataconA$SubSev = factor(dataconA$SubSev,levels=c("Low","Med","High"))
|
---|
| 463 | dataconA$SubSev <- ordered(dataconA$SubSev)
|
---|
| 464 | #Specify levels of SubMoti as Low, Med, High
|
---|
| 465 | dataconA$SubMoti = factor(dataconA$SubMoti,levels=c("Low","Med","High"))
|
---|
| 466 | dataconA$SubMoti <- ordered(dataconA$SubMoti)
|
---|
| 467 |
|
---|
| 468 | #Specify levels for ScenSev as Low, Med, High
|
---|
| 469 | dataconA$ScenSev = factor(dataconA$ScenSev,levels=c("Low","Med","High"))
|
---|
| 470 | dataconA$ScenSev <- ordered(dataconA$ScenSev)
|
---|
| 471 | #Specify levels of ScenMoti as Low, Med, High
|
---|
| 472 | dataconA$ScenMoti = factor(dataconA$ScenMoti,levels=c("Low","Med","High"))
|
---|
| 473 | dataconA$ScenMoti <- ordered(dataconA$ScenMoti)
|
---|
| 474 |
|
---|
| 475 | dataconA$Condition = factor(dataconA$Condition,levels=c("motivate","system"))
|
---|
| 476 | dataconA$ppCode = factor(dataconA$ppCode)
|
---|
| 477 |
|
---|
| 478 | #HELP
|
---|
| 479 | Modelc_hA <- lme(fixed = Help~1, random = ~1 | ppCode, data = dataconA, method = "ML")
|
---|
| 480 | summary(Modelc_hA)
|
---|
| 481 |
|
---|
| 482 | ggplot(dataconA, aes(x=Help, fill=Condition)) + geom_density(alpha = 0.3)
|
---|
| 483 |
|
---|
| 484 | #Model effect of Condition on Help
|
---|
| 485 | Modelc_hConA <- lme(fixed = Help~Condition, random = ~1 | ppCode, data = dataconA, method = "ML")
|
---|
| 486 | summary(Modelc_hConA)
|
---|
| 487 | #Vergelijk of model MatchSys_aa beter 'MatchSys' heeft dan model test. Lagere logLik is betere MatchSys
|
---|
| 488 | anova(Modelc_hA,Modelc_hConA)
|
---|
| 489 | anova(Modelc_hConA)
|
---|
| 490 |
|
---|
| 491 | #Return
|
---|
| 492 | Modelc_rA <- lme(fixed = Return~1, random = ~1 | ppCode, data = dataconA, method = "ML")
|
---|
| 493 | summary(Modelc_rA)
|
---|
| 494 |
|
---|
| 495 | ggplot(dataconA, aes(x=Return, fill=Condition)) + geom_density(alpha = 0.3)
|
---|
| 496 |
|
---|
| 497 | #Model effect of Condition on Return
|
---|
| 498 | Modelc_rConA <- lme(fixed = Return~Condition, random = ~1 | ppCode, data = dataconA, method = "ML")
|
---|
| 499 | summary(Modelc_rConA)
|
---|
| 500 | #Vergelijk of model MatchSys_aa beter 'MatchSys' heeft dan model test. Lagere logLik is betere MatchSys
|
---|
| 501 | anova(Modelc_rA,Modelc_rConA)
|
---|
| 502 | anova(Modelc_rConA)
|
---|
| 503 |
|
---|
| 504 | #ALLI
|
---|
| 505 | Modelc_aA <- lme(fixed = FBH~1, random = ~1 | ppCode, data = dataconA, method = "ML")
|
---|
| 506 | summary(Modelc_aA)
|
---|
| 507 |
|
---|
| 508 | ggplot(dataconA, aes(x=FBH, fill=Condition)) + geom_density(alpha = 0.3)
|
---|
| 509 |
|
---|
| 510 | #Model effect of Condition on FBH
|
---|
| 511 | Modelc_aConA <- lme(fixed = FBH~Condition, random = ~1 | ppCode, data = dataconA, method = "ML")
|
---|
| 512 | summary(Modelc_aConA)
|
---|
| 513 | #Vergelijk of model MatchSys_aa beter 'MatchSys' heeft dan model test. Lagere logLik is betere MatchSys
|
---|
| 514 | anova(Modelc_aA,Modelc_aConA)
|
---|
| 515 | anova(Modelc_aConA)
|
---|
| 516 |
|
---|
| 517 |
|
---|
| 518 | #REFER
|
---|
| 519 | dataconR <- read_excel("PATH/Data_conditionsSMrefer.xlsx")
|
---|
| 520 | #View(datacon)
|
---|
| 521 |
|
---|
| 522 | #Specify levels of MatchSys as 0 or 1
|
---|
| 523 | dataconR$MatchSys = factor(dataconR$MatchSys,levels=c(0,1))
|
---|
| 524 | #Specify levels for Route as Motiv, Accept or Refer
|
---|
| 525 | dataconR$Route = factor(dataconR$Route,levels=c("motivate","accept","refer"))
|
---|
| 526 |
|
---|
| 527 | #Specify levels for SubSev as Low, Med, High
|
---|
| 528 | dataconR$SubSev = factor(dataconR$SubSev,levels=c("Low","Med","High"))
|
---|
| 529 | dataconR$SubSev <- ordered(dataconR$SubSev)
|
---|
| 530 | #Specify levels of SubMoti as Low, Med, High
|
---|
| 531 | dataconR$SubMoti = factor(dataconR$SubMoti,levels=c("Low","Med","High"))
|
---|
| 532 | dataconR$SubMoti <- ordered(dataconR$SubMoti)
|
---|
| 533 |
|
---|
| 534 | #Specify levels for ScenSev as Low, Med, High
|
---|
| 535 | dataconR$ScenSev = factor(dataconR$ScenSev,levels=c("Low","Med","High"))
|
---|
| 536 | dataconR$ScenSev <- ordered(dataconR$ScenSev)
|
---|
| 537 | #Specify levels of ScenMoti as Low, Med, High
|
---|
| 538 | dataconR$ScenMoti = factor(dataconR$ScenMoti,levels=c("Low","Med","High"))
|
---|
| 539 | dataconR$ScenMoti <- ordered(dataconR$ScenMoti)
|
---|
| 540 |
|
---|
| 541 | dataconR$Condition = factor(dataconR$Condition,levels=c("motivate","system"))
|
---|
| 542 | dataconR$ppCode = factor(dataconR$ppCode)
|
---|
| 543 |
|
---|
| 544 | #HELP
|
---|
| 545 | Modelc_hR <- lme(fixed = Help~1, random = ~1 | ppCode, data = dataconR, method = "ML")
|
---|
| 546 | summary(Modelc_hR)
|
---|
| 547 |
|
---|
| 548 | ggplot(dataconR, aes(x=Help, fill=Condition)) + geom_density(alpha = 0.3)
|
---|
| 549 |
|
---|
| 550 | #Model effect of Condition on Help
|
---|
| 551 | Modelc_hConR <- lme(fixed = Help~Condition, random = ~1 | ppCode, data = dataconR, method = "ML")
|
---|
| 552 | summary(Modelc_hConR)
|
---|
| 553 | #Vergelijk of model MatchSys_aa beter 'MatchSys' heeft dan model test. Lagere logLik is betere MatchSys
|
---|
| 554 | anova(Modelc_hR,Modelc_hConR)
|
---|
| 555 | anova(Modelc_hConR)
|
---|
| 556 |
|
---|
| 557 | #Return
|
---|
| 558 | Modelc_rR <- lme(fixed = Return~1, random = ~1 | ppCode, data = dataconR, method = "ML")
|
---|
| 559 | summary(Modelc_rR)
|
---|
| 560 |
|
---|
| 561 | ggplot(dataconR, aes(x=Return, fill=Condition)) + geom_density(alpha = 0.3)
|
---|
| 562 |
|
---|
| 563 | #Model effect of Condition on Return
|
---|
| 564 | Modelc_rConR <- lme(fixed = Return~Condition, random = ~1 | ppCode, data = dataconR, method = "ML")
|
---|
| 565 | summary(Modelc_rConR)
|
---|
| 566 | #Vergelijk of model MatchSys_aa beter 'MatchSys' heeft dan model test. Lagere logLik is betere MatchSys
|
---|
| 567 | anova(Modelc_rR,Modelc_rConR)
|
---|
| 568 | anova(Modelc_rConR)
|
---|
| 569 |
|
---|
| 570 | #ALLI
|
---|
| 571 | Modelc_aR <- lme(fixed = FBH~1, random = ~1 | ppCode, data = dataconR, method = "ML")
|
---|
| 572 | summary(Modelc_aR)
|
---|
| 573 |
|
---|
| 574 | ggplot(dataconR, aes(x=FBH, fill=Condition)) + geom_density(alpha = 0.3)
|
---|
| 575 |
|
---|
| 576 | #Model effect of Condition on FBH
|
---|
| 577 | Modelc_aConR <- lme(fixed = FBH~Condition, random = ~1 | ppCode, data = dataconR, method = "ML")
|
---|
| 578 | summary(Modelc_aConR)
|
---|
| 579 | #Vergelijk of model MatchSys_aa beter 'MatchSys' heeft dan model test. Lagere logLik is betere MatchSys
|
---|
| 580 | anova(Modelc_aR,Modelc_aConR)
|
---|
| 581 | anova(Modelc_aConR)
|
---|
| 582 |
|
---|
| 583 |
|
---|
| 584 |
|
---|
| 585 |
|
---|
| 586 |
|
---|
| 587 |
|
---|
| 588 |
|
---|
| 589 |
|
---|
| 590 |
|
---|
| 591 |
|
---|
| 592 | #REGION WHY NOT
|
---|
| 593 | ggplot(data, aes(x=Help, fill=WhyTxt)) + geom_density(alpha = 0.3)
|
---|
| 594 | ggplot(data, aes(x=FBH, fill=WhyTxt)) + geom_density(alpha = 0.3)
|
---|
| 595 | ggplot(data, aes(x=Return, fill=WhyTxt)) + geom_density(alpha = 0.3)
|
---|
| 596 |
|
---|
| 597 | Model_null_h <- lme(fixed = Help~1, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 598 | summary(Model_null_h)
|
---|
| 599 | Model_W_h<- lme(fixed = Help~WhyTxt, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 600 | summary(Model_W_h)
|
---|
| 601 | anova(Model_null_h,Model_W_h)
|
---|
| 602 |
|
---|
| 603 | Model_null_a <- lme(fixed = FBH~1, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 604 | summary(Model_null_a)
|
---|
| 605 | Model_W_a<- lme(fixed = FBH~WhyTxt, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 606 | summary(Model_W_a)
|
---|
| 607 | anova(Model_null_a,Model_W_a)
|
---|
| 608 |
|
---|
| 609 | Model_null_r <- lme(fixed = Return~1, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 610 | summary(Model_null_r)
|
---|
| 611 | Model_W_r<- lme(fixed = Return~WhyTxt, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 612 | summary(Model_W_r)
|
---|
| 613 | anova(Model_null_r,Model_W_r)
|
---|
| 614 |
|
---|
| 615 |
|
---|
| 616 |
|
---|
| 617 |
|
---|
| 618 | #REGION ISI + age Stats
|
---|
| 619 | mean(data$ISITot)
|
---|
| 620 | sd(data$ISITot)
|
---|
| 621 |
|
---|
| 622 | mean(data$Age)
|
---|
| 623 | sd(data$Age)
|
---|
| 624 |
|
---|
| 625 | #Correlations ISI&Gender + ISI & Age
|
---|
| 626 | datapp <- read_excel("PATH/ppData.xlsx")
|
---|
| 627 | View(datapp)
|
---|
| 628 | datapp$Gen = factor(datapp$Gen,levels=c("F","M"))
|
---|
| 629 | spearman.test(datapp$Gen,datapp$ISITot)
|
---|
| 630 | spearman.test(datapp$Age,datapp$ISITot)
|
---|
| 631 |
|
---|
| 632 | #Correlation Return & Allia & HELP
|
---|
| 633 | spearman.test(data$FBH,data$Return)
|
---|
| 634 | spearman.test(data$Help,data$Return)
|
---|
| 635 | spearman.test(data$FBH,data$Help)
|
---|
| 636 |
|
---|
| 637 |
|
---|
| 638 |
|
---|
| 639 |
|
---|
| 640 |
|
---|
| 641 | #REGION ALLIANCE
|
---|
| 642 |
|
---|
| 643 | #Null model for Agent Attitude
|
---|
| 644 | Model_null_aa <- lme(fixed = FBH~1, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 645 | summary(Model_null_aa)
|
---|
| 646 |
|
---|
| 647 | Model_ISI_aa<- lme(fixed = FBH~Age, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 648 | summary(Model_ISI_aa)
|
---|
| 649 |
|
---|
| 650 | anova(Model_null_aa,Model_ISI_aa)
|
---|
| 651 |
|
---|
| 652 | #Model effect of MatchSys on Agent Attitude
|
---|
| 653 | Model_MatchSys_aa <- lme(fixed = FBH~MatchSys, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 654 | summary(Model_MatchSys_aa)
|
---|
| 655 | #Vergelijk of model MatchSys_aa beter 'MatchSys' heeft dan model test. Lagere logLik is betere MatchSys
|
---|
| 656 | anova(Model_null_aa,Model_MatchSys_aa)
|
---|
| 657 |
|
---|
| 658 | #Model effect of Route on Agent Attitude
|
---|
| 659 | Model_route_aa <- lme(fixed = FBH~Route, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 660 | summary(Model_route_aa)
|
---|
| 661 | #Vergelijk of model route_aa beter 'MatchSys' heeft dan model test. Lagere logLik is betere MatchSys
|
---|
| 662 | anova(Model_null_aa,Model_route_aa)
|
---|
| 663 |
|
---|
| 664 | #Model effect of Route & MatchSys on Agent Attitude
|
---|
| 665 | Model_routeMatchSys_aa<- lme(fixed = FBH~Route+MatchSys, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 666 | summary(Model_routeMatchSys_aa)
|
---|
| 667 | #Vergelijk of model routeMatchSys_aa beter 'MatchSys' heeft dan model route. Lagere logLik is betere MatchSys
|
---|
| 668 | anova(Model_route_aa,Model_routeMatchSys_aa)
|
---|
| 669 |
|
---|
| 670 | #Model effect of Route & MatchSys & ScenSev on Agent Attitude
|
---|
| 671 | Model_routeMatchSyssev_aa<- lme(fixed = FBH~Route+MatchSys+ScenSev, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 672 | summary(Model_routeMatchSyssev_aa)
|
---|
| 673 | #Vergelijk of model routeMatchSyssev_aa beter 'MatchSys' heeft dan model routeMatchSys_aa. Lagere logLik is betere MatchSys
|
---|
| 674 | anova(Model_routeMatchSys_aa,Model_routeMatchSyssev_aa)
|
---|
| 675 |
|
---|
| 676 | #Model effect of Route & MatchSys & ScenSev on Agent Attitude
|
---|
| 677 | Model_routeMatchSevMoti_aa<- lme(fixed = FBH~Route+MatchSys+ScenSev+ScenMoti, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 678 | summary(Model_routeMatchSevMoti_aa)
|
---|
| 679 | #Vergelijk of model routeMatchSyssev_aa beter 'MatchSys' heeft dan model routeMatchSys_aa. Lagere logLik is betere MatchSys
|
---|
| 680 | anova(Model_routeMatchSys_aa,Model_routeMatchSevMoti_aa)
|
---|
| 681 |
|
---|
| 682 |
|
---|
| 683 | #InterHelp effects lme (doesn't work...)
|
---|
| 684 | #Model_interHelp1 <- lme(fixed = FBH~Route:ScenSev:ScenMoti, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 685 | #Model_interHelp2 <- lme(fixed = FBH~Route:ScenMoti, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 686 |
|
---|
| 687 | #InterHelp effects lmer (werkt maar met waarschuwing) -
|
---|
| 688 | Model_interHelp3 <- lmer(FBH~Route:ScenSev:ScenMoti +(1|ppCode), data = data)
|
---|
| 689 | summary(Model_interHelp3)
|
---|
| 690 |
|
---|
| 691 | #Full model Route, MatchSys & ScenSev + interaction effects on Agent Attitude
|
---|
| 692 | Model_full_aa <- lme(fixed = FBH~Route+ScenSev+ScenMoti+Route:ScenSev+Route:ScenMoti+ScenSev:ScenMoti+Route:ScenSev:ScenMoti, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 693 | summary(Model_full_aa)
|
---|
| 694 |
|
---|
| 695 |
|
---|
| 696 |
|
---|
| 697 | #REGION Help
|
---|
| 698 |
|
---|
| 699 | #Null model for Help
|
---|
| 700 | Model_null_a <- lme(fixed = Help~1, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 701 | summary(Model_null_a)
|
---|
| 702 |
|
---|
| 703 | Model_ISI_h<- lme(fixed = Help~Age, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 704 | summary(Model_ISI_h)
|
---|
| 705 |
|
---|
| 706 | anova(Model_null_a,Model_ISI_h)
|
---|
| 707 |
|
---|
| 708 | #Model effect of MatchSys on Help
|
---|
| 709 | Model_MatchSys_a <- lme(fixed = Help~MatchSys, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 710 | summary(Model_MatchSys_a)
|
---|
| 711 | #Vergelijk of model MatchSys_aa beter 'MatchSys' heeft dan model test. Lagere logLik is betere MatchSys
|
---|
| 712 | anova(Model_null_a,Model_MatchSys_a)
|
---|
| 713 |
|
---|
| 714 | #Model effect of Route on Help
|
---|
| 715 | Model_route_a <- lme(fixed = Help~Route, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 716 | summary(Model_route_a)
|
---|
| 717 | #Vergelijk of model route_aa beter 'MatchSys' heeft dan model test. Lagere logLik is betere MatchSys
|
---|
| 718 | anova(Model_null_a,Model_route_a)
|
---|
| 719 |
|
---|
| 720 | #Model effect of Route & MatchSys on Help
|
---|
| 721 | Model_routeMatchSys_a<- lme(fixed = Help~Route+MatchSys, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 722 | summary(Model_routeMatchSys_a)
|
---|
| 723 | #Vergelijk of model routeMatchSys_a beter 'MatchSys' heeft dan model route. Lagere logLik is betere MatchSys
|
---|
| 724 | anova(Model_route_a,Model_routeMatchSys_a)
|
---|
| 725 |
|
---|
| 726 | #Model effect of Route & MatchSys & ScenSevon Help
|
---|
| 727 | Model_routeMatchSyssev_a<- lme(fixed = Help~Route+MatchSys+ScenSev, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 728 | summary(Model_routeMatchSyssev_a)
|
---|
| 729 | #Vergelijk of model routeMatchSyssev_a beter 'MatchSys' heeft dan model routeMatchSys_a. Lagere logLik is betere MatchSys
|
---|
| 730 | anova(Model_routeMatchSys_a,Model_routeMatchSyssev_a)
|
---|
| 731 |
|
---|
| 732 | #Model effect of Route & MatchSys & ScenSevon Help
|
---|
| 733 | Model_routeMatchSevMoti_a<- lme(fixed = Help~Route+MatchSys+ScenSev+ScenMoti, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 734 | summary(Model_routeMatchSevMoti_a)
|
---|
| 735 | #Vergelijk of model routeMatchSyssev_a beter 'MatchSys' heeft dan model routeMatchSys_a. Lagere logLik is betere MatchSys
|
---|
| 736 | anova(Model_routeMatchSys_a,Model_routeMatchSevMoti_a)
|
---|
| 737 |
|
---|
| 738 | #InterHelp effects lme (doesn't work...)
|
---|
| 739 | #Model_interHelp1 <- lme(fixed = Help~Route:ScenSev:ScenMoti, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 740 | #Model_interHelp2 <- lme(fixed = Help~Route:ScenMoti, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 741 |
|
---|
| 742 | #InterHelp effects lmer (werkt maar met waarschuwing) -
|
---|
| 743 | Model_interHelp3 <- lmer(Help~Route:ScenSev:ScenMoti +(1|ppCode), data = data)
|
---|
| 744 | summary(Model_interHelp3)
|
---|
| 745 |
|
---|
| 746 | #Full model Route, MatchSys & ScenSev + interHelp effects on Help
|
---|
| 747 | Model_full_a <- lme(fixed = Help~Route+ScenSev+ScenMoti+Route:ScenSev+Route:ScenMoti+ScenSev:ScenMoti+Route:ScenSev:ScenMoti, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 748 | summary(Model_full_a)
|
---|
| 749 |
|
---|
| 750 |
|
---|
| 751 | #REGION
|
---|
| 752 | #Null model for Return
|
---|
| 753 | Model_null_r <- lme(fixed = Return~1, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 754 | summary(Model_null_r)
|
---|
| 755 |
|
---|
| 756 | Model_ISI_r<- lme(fixed = Return~Age, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 757 | summary(Model_ISI_r)
|
---|
| 758 |
|
---|
| 759 | anova(Model_null_r,Model_ISI_r)
|
---|
| 760 |
|
---|
| 761 | #Model effect of MatchSys on Help
|
---|
| 762 | Model_MatchSys_a <- lme(fixed = Help~MatchSys, random = ~1 | ppCode, data = data, method = "ML")
|
---|
| 763 | summary(Model_MatchSys_a)
|
---|
| 764 | #Vergelijk of model MatchSys_aa beter 'MatchSys' heeft dan model test. Lagere logLik is betere MatchSys
|
---|
| 765 | anova(Model_null_a,Model_MatchSys_a)
|
---|
| 766 |
|
---|
| 767 |
|
---|
| 768 |
|
---|
| 769 |
|
---|
| 770 |
|
---|
| 771 | #Conditions SYSTEM VS MOTIVATION
|
---|
| 772 | datacon <- read_excel("PATH/Data_conditionsSM.xlsx")
|
---|
| 773 | #View(datacon)
|
---|
| 774 |
|
---|
| 775 | #Specify levels of MatchSys as 0 or 1
|
---|
| 776 | datacon$MatchSys = factor(datacon$MatchSys,levels=c(0,1))
|
---|
| 777 | #Specify levels for Route as Motiv, Accept or Refer
|
---|
| 778 | datacon$Route = factor(datacon$Route,levels=c("motivate","accept","refer"))
|
---|
| 779 |
|
---|
| 780 | #Specify levels for SubSev as Low, Med, High
|
---|
| 781 | datacon$SubSev = factor(datacon$SubSev,levels=c("Low","Med","High"))
|
---|
| 782 | datacon$SubSev <- ordered(datacon$SubSev)
|
---|
| 783 | #Specify levels of SubMoti as Low, Med, High
|
---|
| 784 | datacon$SubMoti = factor(datacon$SubMoti,levels=c("Low","Med","High"))
|
---|
| 785 | datacon$SubMoti <- ordered(datacon$SubMoti)
|
---|
| 786 |
|
---|
| 787 | #Specify levels for ScenSev as Low, Med, High
|
---|
| 788 | datacon$ScenSev = factor(datacon$ScenSev,levels=c("Low","Med","High"))
|
---|
| 789 | datacon$ScenSev <- ordered(datacon$ScenSev)
|
---|
| 790 | #Specify levels of ScenMoti as Low, Med, High
|
---|
| 791 | datacon$ScenMoti = factor(datacon$ScenMoti,levels=c("Low","Med","High"))
|
---|
| 792 | datacon$ScenMoti <- ordered(datacon$ScenMoti)
|
---|
| 793 |
|
---|
| 794 | datacon$Condition = factor(datacon$Condition,levels=c("motivate","system"))
|
---|
| 795 | datacon$ppCode = factor(datacon$ppCode)
|
---|
| 796 |
|
---|
| 797 |
|
---|
| 798 | #HELP
|
---|
| 799 |
|
---|
| 800 | #Null
|
---|
| 801 | Model_h <- lme(fixed = Help~1, random = ~1 | ppCode, data = datacon, method = "ML")
|
---|
| 802 | summary(Model_h)
|
---|
| 803 |
|
---|
| 804 | ggplot(datacon, aes(x=Help, fill=Condition)) + geom_density(alpha = 0.3)
|
---|
| 805 |
|
---|
| 806 | #Model effect of Condition on Help
|
---|
| 807 | Model_hCon <- lme(fixed = Help~Condition, random = ~1 | ppCode, data = datacon, method = "ML")
|
---|
| 808 | summary(Model_hCon)
|
---|
| 809 | #Vergelijk of model MatchSys_aa beter 'MatchSys' heeft dan model test. Lagere logLik is betere MatchSys
|
---|
| 810 | anova(Model_h,Model_hCon)
|
---|
| 811 |
|
---|
| 812 | #Model effect of Condition on Help
|
---|
| 813 | Model_hConISI <- lme(fixed = Help~Condition+Gen, random = ~1 | ppCode, data = datacon, method = "ML")
|
---|
| 814 | summary(Model_hConISI)
|
---|
| 815 | #Vergelijk of model MatchSys_aa beter 'MatchSys' heeft dan model test. Lagere logLik is betere MatchSys
|
---|
| 816 | anova(Model_hCon,Model_hConISI)
|
---|
| 817 |
|
---|
| 818 |
|
---|
| 819 | ggplot(datacon, aes(x=Help, fill=Systemroute)) + geom_density(alpha = 0.3)
|
---|
| 820 |
|
---|
| 821 | #Model effect of Condition+route on Help
|
---|
| 822 | Model_hConSys <- lme(fixed = Help~Condition+Systemroute, random = ~1 | ppCode, data = datacon, method = "ML")
|
---|
| 823 | summary(Model_hConSys)
|
---|
| 824 | #Vergelijk of model MatchSys_aa beter 'MatchSys' heeft dan model test. Lagere logLik is betere MatchSys
|
---|
| 825 | anova(Model_hCon,Model_hConSys)
|
---|
| 826 |
|
---|
| 827 | #Model effect of Condition+route on Help
|
---|
| 828 | Model_hConSysInt <- lme(fixed = Help~Condition+Systemroute+Condition:Systemroute, random = ~1 | ppCode, data = datacon, method = "ML")
|
---|
| 829 | summary(Model_hConSysInt)
|
---|
| 830 | #Vergelijk of model MatchSys_aa beter 'MatchSys' heeft dan model test. Lagere logLik is betere MatchSys
|
---|
| 831 | anova(Model_hConSys,Model_hConSysInt)
|
---|
| 832 |
|
---|
| 833 | #Model effect of Condition+route on Help
|
---|
| 834 | Model_hConSysInta <- lmer(Help~ScenMoti:ScenSev:Route+ (1|ppCode), data = data)
|
---|
| 835 | summary(Model_hConSysInta)
|
---|
| 836 | #Vergelijk of model MatchSys_aa beter 'MatchSys' heeft dan model test. Lagere logLik is betere MatchSys
|
---|
| 837 | anova(Model_hConSysInta)
|
---|
| 838 |
|
---|
| 839 |
|
---|
| 840 |
|
---|
| 841 | anova(Model_hConSysInt)
|
---|
| 842 |
|
---|
| 843 |
|
---|
| 844 | #RETURN
|
---|
| 845 |
|
---|
| 846 | #Null
|
---|
| 847 | Model_r <- lme(fixed = Return~1, random = ~1 | ppCode, data = datacon, method = "ML")
|
---|
| 848 | summary(Model_r)
|
---|
| 849 |
|
---|
| 850 | ggplot(datacon, aes(x=Return, fill=Condition)) + geom_density(alpha = 0.3)
|
---|
| 851 |
|
---|
| 852 | #Model effect of Condition on Help
|
---|
| 853 | Model_rCon <- lme(fixed = Return~Condition, random = ~1 | ppCode, data = datacon, method = "ML")
|
---|
| 854 | summary(Model_rCon)
|
---|
| 855 | #Vergelijk of model MatchSys_aa beter 'MatchSys' heeft dan model test. Lagere logLik is betere MatchSys
|
---|
| 856 | anova(Model_r,Model_rCon)
|
---|
| 857 |
|
---|
| 858 | #Model effect of Condition on Help
|
---|
| 859 | Model_rConISI <- lme(fixed = Return~Condition+Gen, random = ~1 | ppCode, data = datacon, method = "ML")
|
---|
| 860 | summary(Model_rConISI)
|
---|
| 861 | #Vergelijk of model MatchSys_aa beter 'MatchSys' heeft dan model test. Lagere logLik is betere MatchSys
|
---|
| 862 | anova(Model_rCon,Model_rConISI)
|
---|
| 863 |
|
---|
| 864 | ggplot(datacon, aes(x=Return, fill=Systemroute)) + geom_density(alpha = 0.3)
|
---|
| 865 |
|
---|
| 866 | #Model effect of Condition+route on Help
|
---|
| 867 | Model_rConSys <- lme(fixed = Return~Condition+Systemroute, random = ~1 | ppCode, data = datacon, method = "ML")
|
---|
| 868 | summary(Model_rConSys)
|
---|
| 869 | #Vergelijk of model MatchSys_aa beter 'MatchSys' heeft dan model test. Lagere logLik is betere MatchSys
|
---|
| 870 | anova(Model_rCon,Model_rConSys)
|
---|
| 871 |
|
---|
| 872 |
|
---|
| 873 | #ALLIANCE
|
---|
| 874 |
|
---|
| 875 | #Null
|
---|
| 876 | Model_a <- lme(fixed = FBH~1, random = ~1 | ppCode, data = datacon, method = "ML")
|
---|
| 877 | summary(Model_a)
|
---|
| 878 |
|
---|
| 879 | ggplot(datacon, aes(x=FBH, fill=Condition)) + geom_density(alpha = 0.3)
|
---|
| 880 |
|
---|
| 881 | #Model effect of Condition on Help
|
---|
| 882 | Model_aCon <- lme(fixed = FBH~Condition, random = ~1 | ppCode, data = datacon, method = "ML")
|
---|
| 883 | summary(Model_aCon)
|
---|
| 884 | #Vergelijk of model MatchSys_aa beter 'MatchSys' heeft dan model test. Lagere logLik is betere MatchSys
|
---|
| 885 | anova(Model_a,Model_aCon)
|
---|
| 886 |
|
---|
| 887 | #Model effect of Condition on Help
|
---|
| 888 | Model_aConISI <- lme(fixed = FBH~Condition+Gen, random = ~1 | ppCode, data = datacon, method = "ML")
|
---|
| 889 | summary(Model_aConISI)
|
---|
| 890 | #Vergelijk of model MatchSys_aa beter 'MatchSys' heeft dan model test. Lagere logLik is betere MatchSys
|
---|
| 891 | anova(Model_aCon,Model_aConISI)
|
---|
| 892 |
|
---|
| 893 | ggplot(datacon, aes(x=FBH, fill=Systemroute)) + geom_density(alpha = 0.3)
|
---|
| 894 |
|
---|
| 895 | #Model effect of Condition+route on Help
|
---|
| 896 | Model_aConSys <- lme(fixed = FBH~Condition+Systemroute, random = ~1 | ppCode, data = datacon, method = "ML")
|
---|
| 897 | summary(Model_aConSys)
|
---|
| 898 | #Vergelijk of model MatchSys_aa beter 'MatchSys' heeft dan model test. Lagere logLik is betere MatchSys
|
---|
| 899 | anova(Model_aCon,Model_aConSys)
|
---|
| 900 |
|
---|