Without Comments

mail@pastecode.io avatar
unknown
plain_text
2 years ago
388 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)
return(j)}
q<-s("true winners")
g<-function(y){
f<-function(x,y)lm(x~b,y)
modelsummary(list(f(y[,10],y),f(y[,11],y)),
stars=TRUE,gof_map=c("nobs","adj.r.squared"))}
g(q)
e<-s("treated")
g(e)