further refining rdd
This commit is contained in:
parent
63c527fcb5
commit
a5b7ab562c
@ -31,12 +31,17 @@ expanded_data <- expand_timeseries(readme_df[1,])
|
||||
for (i in 2:nrow(readme_df)){
|
||||
expanded_data <- rbind(expanded_data, expand_timeseries(readme_df[i,]))
|
||||
}
|
||||
#filter out the timewindows
|
||||
#filter out the windows of time that we're looking at
|
||||
window_num <- 8
|
||||
expanded_data <- expanded_data |>
|
||||
filter(week >= (26 - window_num) & week <= (26 + window_num)) |>
|
||||
mutate(D = ifelse(week >= 26, 1, 0))
|
||||
mutate(D = ifelse(week > 26, 1, 0))
|
||||
# 3 rdd in lmer analysis
|
||||
# rdd: https://rpubs.com/phle/r_tutorial_regression_discontinuity_design
|
||||
# lmer: https://www.youtube.com/watch?v=LzAwEKrn2Mc
|
||||
library(lme4)
|
||||
draft_model <- lmer(count ~ D * I(week - 26) + (1|upstream_vcs_link), REML=FALSE, data=expanded_data[which(expanded_data$observation_type == "all"),])
|
||||
summary(draft_model)
|
||||
draft_all_model <- lmer(count ~ D * I(week - 26) + (1|upstream_vcs_link), REML=FALSE, data=expanded_data[which(expanded_data$observation_type == "all"),])
|
||||
summary(draft_all_model)
|
||||
draft_mrg_model <- lmer(count ~ D * I(week - 26) + (1|upstream_vcs_link), REML=FALSE, data=expanded_data[which(expanded_data$observation_type == "mrg"),])
|
||||
summary(draft_mrg_model)
|
||||
# need to calculate inter-class correlation coefficient?
|
Loading…
Reference in New Issue
Block a user