library(lmtest)
#> Loading required package: zoo
#>
#> Attaching package: 'zoo'
#> The following objects are masked from 'package:base':
#>
#> as.Date, as.Date.numeric
library(lfe)
#> Loading required package: Matrix
#>
#> Attaching package: 'lfe'
#> The following object is masked from 'package:lmtest':
#>
#> waldtest
data1= subset(master_data_clean, master_data_clean$haryana==1)
#> Error in subset(master_data_clean, master_data_clean$haryana == 1): object 'master_data_clean' not found
model1= lm(latrine~ mboy_post +mboy +post, data= subset(master_data_clean, master_data_clean$haryana==1))
#> Error in subset(master_data_clean, master_data_clean$haryana == 1): object 'master_data_clean' not found
vcov1= cluster.vcov(model1, ~data1$district)
#> Error in cluster.vcov(model1, ~data1$district): could not find function "cluster.vcov"
coeftest(model1, vcov1)
#> Error in coeftest(model1, vcov1): object 'model1' not found
summary(model1)
#> Error in summary(model1): object 'model1' not found
coef_test(model1, vcov = "CR1S", cluster = data1$district, test = "naive-t")
#> Error in coef_test(model1, vcov = "CR1S", cluster = data1$district, test = "naive-t"): could not find function "coef_test"
sum(master_data_clean$haryana)
#> Error in eval(expr, envir, enclos): object 'master_data_clean' not found
install.packages("clusterSEs")
#> also installing the dependencies 'miscTools', 'bdsmatrix', 'maxLik', 'statmod', 'plm', 'mlogit'
#> package 'miscTools' successfully unpacked and MD5 sums checked
#> package 'bdsmatrix' successfully unpacked and MD5 sums checked
#> package 'maxLik' successfully unpacked and MD5 sums checked
#> package 'statmod' successfully unpacked and MD5 sums checked
#> package 'plm' successfully unpacked and MD5 sums checked
#> package 'mlogit' successfully unpacked and MD5 sums checked
#> package 'clusterSEs' successfully unpacked and MD5 sums checked
#>
#> The downloaded binary packages are in
#> C:\Users\Tej\AppData\Local\Temp\RtmpKa9qgx\downloaded_packages
model2= lm(latrine~ as.factor(mboy_post)+ as.factor(mboy) +as.factor(post)+ hhsize+ agehead+ agewife+ educhead+ educwife+ wealth, data= data1)
#> Error in is.data.frame(data): object 'data1' not found
coef_test(model2, vcov = "CR1S", cluster = data1$district, test = "naive-t")
#> Error in coef_test(model2, vcov = "CR1S", cluster = data1$district, test = "naive-t"): could not find function "coef_test"
vcov2= cluster.vcov(model2, ~data1$district)
#> Error in cluster.vcov(model2, ~data1$district): could not find function "cluster.vcov"
coeftest(model2, vcov2)
#> Error in coeftest(model2, vcov2): object 'model2' not found
model1_clustered= felm(latrine~ mboy_post +mboy +post | 0 | 0 | district, data=data1)
#> Error in ..pdata.coerce..(data1): object 'data1' not found
summary(model1_clustered)
#> Error in summary(model1_clustered): object 'model1_clustered' not found
Created on 2018-03-22 by the reprex package (v0.2.0).