MFW you can do it in 324

mail@pastecode.io avatar
unknown
plain_text
a year ago
324 B
2
Indexable
Never
install.packages("modelsummary")
library(modelsummary)
z<-read.csv("entrepreneurs.csv")
summary(z)
aggregate(.~z[,5],z[(3:10)],mean)
s<-function(i){j<-z[z[,5]!=i,]
j$b<-ifelse(j[,5]=="control",0,1)
modelsummary(list(lm(j[,10]~b,j),lm(j[,11]~b,j)),stars=TRUE,gof_map=c("nobs","adj.r.squared"))}
s("true winners")
s("treated")