1 Star 0 Fork 1

张剑/Causal-Inference-Using-Quasi-Experimental-Methods

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
2. Interrupted Time Series 554 Bytes
一键复制 编辑 原始数据 按行查看 历史
# A Practitioners Guide To Interrupted Time Series, https://towardsdatascience.com/what-is-the-strongest-quasi-experimental-method-interrupted-time-series-period-f59fe5b00b31
#1 simulated data
# data preparation
set.seed(1)
CaseID = rep(1:100,6)
#some intervention
Intervention = c(rep(0,300), rep(1,300))
Outcome_Variable = c(rnorm(300), abs(rnorm(300)*4))
mydata = cbind(CaseID, Intervention, Outcome_Variable)
mydata = as.data.frame(mydata)
#construct a simple OLS model
model = lm(Outcome_Variable ~ Intervention, data = mydata)
summary(model)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jefeerzhang/Causal-Inference-Using-Quasi-Experimental-Methods.git
git@gitee.com:jefeerzhang/Causal-Inference-Using-Quasi-Experimental-Methods.git
jefeerzhang
Causal-Inference-Using-Quasi-Experimental-Methods
Causal-Inference-Using-Quasi-Experimental-Methods
master

搜索帮助