downloadButton('download_wigs_t', 'Download test wigs'),
HTML('<br><br>')
)
)
),
tabPanel("Analyse Genes",
titlePanel('Analyze Genes of interest'),
HTML('<br><br>'),
sidebarLayout(
sidebarPanel(width=4,
uiOutput("gene_input_ui"),
uiOutput("gene_links")
),
mainPanel(width=7,
DT::dataTableOutput(outputId = 'gene_table'),
bsModal("modal_gene_expt_details", "Experimental Details", "", tableOutput('gene_expt_details'))
)
)
)
)
on_click_js = "
Shiny.onInputChange('gene_selected_expt', '%s');
$('#modal_gene_expt_details').modal('show')
"
convert_to_link = function(x) {
as.character(tags$a(href = "#", onclick = sprintf(on_click_js,x), x))
}
server<-function(input,output){
data<-dbReadTable(conn , name = 'Test3')
metadata<-dbReadTable(conn, name='metadata')
output$expt_input_ui<-renderUI({selectInput(inputId = 'expt_input',
label = 'Select Tn-seq dataset',
choices = unique(data$expt_id),
multiple = FALSE,
selectize = TRUE)})
output$gene_input_ui<-renderUI({selectInput(inputId = 'gene_input',
label = 'Select gene of interest (Use ORF/Gene Name)',
choices=unique(c("",data$ORF, ORF_details$Name)),
multiple=TRUE)})
#session$onSessionEnded(function() {unlink(sessiontemp, recursive = TRUE)})
#output$dir<-renderText(tempdir())
selected_expt<-reactive({data%>%filter(expt_id==input$expt_input)%>%
arrange(desc(log2FC))})
#data_details<-reactive({df_details%>%filter(Expt==input$data_input)})
condition<-reactive({selected_expt()$pval_adj<=input$pval & (selected_expt()$log2FC>=input$log2FC|selected_expt()$log2FC<=(-input$log2FC))})
# output$volcano<-renderPlotly({g<-ggplot(selected_expt(), aes(x=log2FC, y=-log10(pval_adj), label=ORF))+
#     geom_point(col=ifelse(condition(), 'orangered2', 'black'), size=2)+
#     theme(axis.text = element_text(size=12),
#           axis.title = element_text(size=12))+
#     xlab('log2(Fold Change)')+
#     ylab('-log10(p-value)')
#     ggplotly(g, tooltip='label')
# })
#
output$volcano<-renderPlotly({
y<-(-log10(selected_expt()$pval_adj))
y[!is.finite(y)]<-abs(max(is.finite(y)))+1
g<-ggplot(selected_expt(), aes(x=log2FC, y=y, label=ORF))+
geom_point(col=ifelse(condition(), 'orangered2', 'black'), size=2)+
scale_y_continuous(breaks=waiver(), labels=function(breaks){breaks<-replace(breaks, length(breaks), 'Inf')})+
theme(axis.text = element_text(size=9),
axis.title = element_text(size=9))+
xlab('log2(Fold Change)')+
ylab('-log10(p-value)')
ggplotly(g, tooltip='label')%>%config(displaylogo = FALSE,
modeBarButtonsToRemove = c(
'sendDataToCloud',
'autoScale2d',
'resetScale2d',
'hoverClosestCartesian',
'hoverCompareCartesian',
'zoom2d',
'pan2d',
'select2d',
'lasso2d',
'zoomIn2d',
'zoomOut2d'
))
})
display_metadata<-function(metadata, id){
temp<-as.data.frame(t((metadata)%>%filter(expt_id==id)))
temp$fields<-rownames(temp)
colnames(temp)<-c('Entries', 'Fields')
temp<-temp%>%select('Fields', 'Entries')
return(temp)
}
output$expt_table<-DT::renderDataTable({
temp<-selected_expt()
temp$ORF_link<-paste0("<a href='https://mycobrowser.epfl.ch/genes/", temp$ORF, "' target='_blank'>", temp$ORF, "</a>")
ORF_details_desc<-ORF_details%>%select('ORF', 'Description')
temp<-left_join(temp,ORF_details_desc, by='ORF')
temp<-temp%>%filter(condition())%>%select(ORF_link, Description, log2FC, pval_adj)
colnames(temp)<-c('ORF', 'Description', 'log2FC', 'pval_adj')
temp},
# options=list(pageLength=20, autoWidth=TRUE, columnDefs = list(list(width = '50px', targets = c(0,1,2)))),
options=list(pageLength=10),
escape=FALSE,
rownames=FALSE,
selection = 'none')
output$expt_desc <-
renderUI({
HTML(
paste0(
'<span style="color:#ff5733; font-weight:bold; font-size:1.4em">',
input$expt_input,
'</span><br>',
as.character(
metadata %>%
filter(expt_id == input$expt_input) %>% select(expt_desc)
),
'<br>'
)
)
})
output$expt_details <-
renderTable({
display_metadata(metadata, input$expt_input)
}, bordered = TRUE)
output$table_title<-renderUI({HTML('<span style="font-weight:bold; font-size:1.4em">Mutants matching selected cut-off</span></br></br>')})
geneConverter<-function(gene, ORF_details){
if(gene%in%ORF_details$Name){
return(as.character(ORF_details%>%filter(Name==gene)%>%select(ORF)))}
else{return(gene)}
}
genes <-
reactive({
unlist(lapply(input$gene_input, geneConverter, ORF_details))
})
output$gene_table <-
DT::renderDataTable({
temp<-data %>% filter(ORF %in% genes()) %>% select(expt_id, ORF, log2FC, pval_adj) %>%
arrange(ORF)
temp$expt_id<-sapply(temp$expt_id, convert_to_link)
temp
},
escape = FALSE,
rownames = FALSE,
selection = 'none',
filter = 'top',
options = list(pageLength = 25,autoWidth = TRUE,
columnDefs = list(list(width = '300px', targets = c(0)))))
output$gene_expt_details<-renderTable({
display_metadata(metadata, input$gene_selected_expt)
}, bordered = TRUE)
output$gene_links<-renderUI({HTML(paste(unlist(lapply(genes(), geneDetails, ORF_details))))})
geneDetails<-function(gene, ORF_details){
if (gene%in%ORF_details$ORF){
details<-ORF_details%>%filter(ORF==gene)
return(paste0(
details$geneName,
'<br>',
'<span style="font-weight:bold">', details$Description, '</span>',
'<br>',
details$essentiality,
'<br><br>',
details$tuberculist,'<br>',
details$tbdb,'<br>',
details$kegg,'<br>',
details$pubmed, '<br>',
details$pubmed_name, '<br>',
details$google,'<br>',
details$google_name, '<br><hr>'))
} else {return (paste0(gene,'<br>Gene details not available<br><hr>'))}
}
output$download_filtered<-downloadHandler(
filename = function(){paste0(input$expt_input, '_log2FC', input$log2FC, '_pval', input$pval, '.csv')},
content=function(x){
write.csv(selected_expt()%>%filter(condition())%>%select(expt_id, ORF, log2FC, pval_adj), x, row.names = FALSE)}
)
output$download_tsv<-downloadHandler(filename = function(){paste0(input$expt_input, '.tsv')}, content = function(x){
save_object(object=paste0(input$expt_input, '.tsv'), bucket=bucket_excels, file = x)
})
output$download_wigs_c<-
downloadHandler(filename = function(){paste0(input$expt_input, '_wigs_c.zip')},
content = function(fname){
setwd(tempdir())
bucket_list<-get_bucket(bucket_wigs, prefix = paste0(input$expt_input, '_c'))
file_list<-lapply(bucket_list, function(x) x[['Key']])
file_names<-lapply(bucket_list, function(x) unlist(strsplit(x[['Key']], '\\/'))[2])
file_names<-unlist(file_names)
lapply(file_list, function(x) save_object(x, bucket = bucket_wigs))
zip::zip(fname, file_names)
}
)
output$download_wigs_t<-
downloadHandler(filename = function(){paste0(input$expt_input, '_wigs_t.zip')},
content = function(fname){
setwd(tempdir())
bucket_list<-get_bucket(bucket_wigs, prefix = paste0(input$expt_input, '_t'))
file_list<-lapply(bucket_list, function(x) x[['Key']])
file_names<-lapply(bucket_list, function(x) unlist(strsplit(x[['Key']], '\\/'))[2])
file_names<-unlist(file_names)
lapply(file_list, function(x) save_object(x, bucket = bucket_wigs))
zip::zip(fname, file_names)
}
)
}
shinyApp(ui=ui, server=server)
profvis({runApp(appDir = "C:/Users/light/Dropbox (Personal)/Projects/Shiny/Test_with_navbar")})
profvis({runApp(appDir = "C:/Users/light/Dropbox (Personal)/Projects/Shiny/Test_with_navbar")})
profvis({runApp(appDir = "C:/Users/light/Dropbox (Personal)/Projects/Shiny/Test_with_navbar")})
shiny::runApp('C:/Users/light/Dropbox (Personal)/Projects/Shiny/Maintenance')
runApp('C:/Users/light/Dropbox (Personal)/Projects/Shiny/downtime')
?read.csv
WT_TKO <- read.delim("C:/Users/light/Dropbox (Personal)/Projects/Shiny/WT_TKO.dat", header=FALSE, comment.char="#")
View(WT_TKO)
View(WT_TKO)
is.numeric(WT_TKO$V5)
(all(c('V2', 'V3') %in% colnames(data_sql)) ==
FALSE)
(all(c('V2', 'V3') %in% colnames(WT_TKO)) ==
FALSE)
colnames(WT_TKO)
(c('V2', 'V3') %in% colnames(WT_TKO)
)
(c('V2', 'V3') %in% colnames(WT_TKO))
c(c('V2', 'V3') %in% colnames(WT_TKO), is.numeric('V5'))
c(c('V2', 'V3') %in% colnames(WT_TKO), is.numeric(WT_TKO$V5))
c(c('V2', 'V3') %in% colnames(WT_TKO), is.numeric(WT_TKO$V1))
all(c(c('V2', 'V3') %in% colnames(WT_TKO), is.numeric(WT_TKO$V1)))
all(c(c('V2', 'V3') %in% colnames(WT_TKO), is.numeric(WT_TKO$V5)))
all(c(c('V2', 'V3') %in% colnames(WT_TKO), is.numeric(WT_TKO$V5)))
?mapply
'good'%in% c('good')
'good'%in% c()
sum('good'%in% c())
sum('good'%in% c('good', 'good'))
'good'%in% c('good', 'good')
sum('good'==c('good', 'good'))
sum('good'==c())
1:3
a<-character(0)
a<-(a, 'goog')
a<-c(a, 'goog')
a
a<-(a, 'goog')
a<-c(a, 'goog')
a
a<-c(a, 'godddd')
a
a<-0:1
?range
a<-range(1:10)
a<-seq(0,1)
a<-seq(0,1, by=0.05)
num<-a^2*(1-a)^1
factorial(2)
den<-factorial(2)*factorial(1)/(factorial(2+1+1))
y<-num/den
plot(a, y)
a*y
sum(a*y)
sum(y)
y
length(a)
length(y)
a*y
y
0.5^2
0.25*0.5
num
0.125/0.083333
sum(a*y)
(1/20)*11.95
sum(y)
library(ChIPQC)
install.packages('stringi')
library()
if (!( require("edgeR") )) {
if (!require("BiocInstaller")) {
source("http://bioconductor.org/biocLite.R", local=TRUE)
}
biocLite(ask=FALSE, c("edgeR"))
library("edgeR")
}
install.packages("RCurl")
if (!( require("biomaRt") )) {
if (!require("BiocInstaller")) {
source("http://bioconductor.org/biocLite.R", local=TRUE)
}
biocLite(ask=FALSE, c("biomaRt"))
library("biomaRt")
}
if (!require("plyr")) {install.packages("plyr",repos='http://cran.us.r-project.org'); library("plyr")}
if (!require("Cairo")) {install.packages("Cairo",repos='http://cran.us.r-project.org'); library("Cairo")}
if (!require("pheatmap")) {install.packages("pheatmap",repos='http://cran.us.r-project.org'); library("pheatmap")}
if (!require("limma")) {install.packages("limma",repos='http://cran.us.r-project.org'); library("limma")}
if (!require("graphics")) {install.packages("graphics",repos='http://cran.us.r-project.org'); library("graphics")}
if (!require("data.table")) {install.packages("data.table",repos='http://cran.us.r-project.org'); library("data.table")}
if (!require("VennDiagram")) {install.packages("VennDiagram",repos='http://cran.us.r-project.org'); library("VennDiagram")}
#if (!require("lme4")) {install.packages("lme4",repos='http://cran.us.r-project.org'); library("lme4")}
if (!require("binhf")) {install.packages("binhf",repos='http://cran.us.r-project.org'); library("binhf")};
if (!require("ztable")) {install.packages("ztable",repos='http://cran.us.r-project.org'); library("ztable")};
if (!require("devtools")) {install.packages("devtools",repos='http://cran.us.r-project.org'); library("devtools")};
if (!require("tidyr")) {install.packages("tidyr",repos='http://cran.us.r-project.org'); library("tidyr")};
if (!require("dplyr")) {install.packages("dplyr",repos='http://cran.us.r-project.org'); library("dplyr")};
if (!require("dtplyr")) {install.packages("dtplyr",repos='http://cran.us.r-project.org'); library("dtplyr")};
library(limms)
library(limma)
library(data.table)
library('Caito')
library('Cairo')
R.home()
install.packages("googlesheets")
gs_ls()
library(googlesheets)
gs_ls()
gs_ls()
be<-gs_title("Real-Ttime Pledged Amounts")
be<-gs_title("Real-time Pledged Amounts")
be
gs_title()
?gs_title()
as.data.frame(gs_read(ss=be, ws='Pledged Amounts Data'))
df<-as.data.frame(gs_read(ss=be, ws='Pledged Amounts Data'))
mpg
library(ggplot2)
mpg
ggplot(data=mpg, aes(x='class'))
ggplot(data=mpg, aes(x='class', fill='manufacturer'))+geom_bar()
ggplot(data=mpg, aes(x=class, fill=manufacturer))+geom_bar()
ggplot(data=mpg, aes(x=class, fill=manufacturer))+geom_bar()+scale_y_continuous()
ggplot(data=mpg, aes(x=class, fill=manufacturer))+geom_bar()+scale_y_continuous(labels = percent)
ggplot(data=mpg, aes(x=class, fill=manufacturer))+geom_bar()+scale_y_continuous(labels=percent)
ggplot(data=mpg, aes(x=class, fill=manufacturer))+geom_bar()+scale_y_continuous(labels=percent)
ggplot(data=mpg, aes(x=class, fill=manufacturer))+geom_bar(position = fill)
ggplot(data=mpg, aes(x=class, fill=manufacturer))+geom_bar(position = "fill")
library(BayesTree)
library(caret)
setwd("C:/Users/light/Dropbox (Personal)/Projects/sense_and_sensitivity/src")
load("../data/ihdp-raw/ihdp-hill-2011/data/example.data")
set.seed(3847293)
covs.cont=c("bw","momage","nnhealth","birth.o","parity","moreprem","cigs","alcohol","ppvt.imp")
covs.cat=c("bwg","female","mlt.birt","b.marry","livwho","language","whenpren","drugs","othstudy","mom.lths","mom.hs","mom.coll","mom.scoll","site1","site2","site3","site4","site5","site6","site7","site8","momblack","momhisp","momwhite","workdur.imp")
covs=c(covs.cont,covs.cat)
ncovs=length(covs)
usek = na.omit(ihdp[!(ihdp$treat==1 & ihdp$dose400==0),c("iqsb.36","dose400",covs)])
calc_att<-function(data, treat_col, out_col){
Q_cols_drop=c(out_col)
folds <- createFolds(y=data[, out_col], k=10, returnTrain = TRUE)
treat_out<-c()
preds_out<-c()
real_treat_out<-c()
for (n in 1:length(folds)){
data_train <- data[folds[[n]],]
data_test <- data[-folds[[n]],]
xt_Q <- as.matrix(data_train[,!names(data_train) %in% Q_cols_drop])
y_Q <- as.numeric(data_train[,out_col])
x_test_Q <- as.matrix(data_test[,!names(data_test) %in% Q_cols_drop])
xtest_Q0=cbind(x_test_Q)
xtest_Q1=cbind(x_test_Q)
real_treat_out <- c(real_treat_out, xtest_Q0[, treat_col])
real_treat_out <- c(real_treat_out, xtest_Q1[, treat_col])
xtest_Q0[, treat_col]=0
xtest_Q1[, treat_col]=1
x_test=rbind(xtest_Q0, xtest_Q1)
treat_out <- c(treat_out, x_test[, treat_col])
cat(dim(xt_Q), 'yy', dim(y_Q), 'zz', dim(x_test))
bart_Q.tot <- bart(x.train=xt_Q,   y.train=y_Q, x.test = x_test)
preds<-bart_Q.tot['yhat.test'][[1]]
preds<-colMeans(preds)
preds_out<-c(preds_out, preds)
}
att_df=cbind(real_treat_out, treat_out, preds_out)
att_df<-as.data.frame(att_df)
cat(dim(att_df))
att_df<-att_df[which(att_df$real_treat_out)==1,]
cat(dim(att_df))
cat(head(att_df))
att<-mean(att_df[which(att_df$treat_out==1), 'preds_out']-att_df[which(att_df$treat_out==0), 'preds_out'])
sd_y<-sd(data[, out_col])
cat(att, sd_y)
}
calc_att(usek, "dose400", "iqsb.36")
library(BayesTree)
library(caret)
setwd("C:/Users/light/Dropbox (Personal)/Projects/sense_and_sensitivity/src")
load("../data/ihdp-raw/ihdp-hill-2011/data/example.data")
set.seed(3847293)
covs.cont=c("bw","momage","nnhealth","birth.o","parity","moreprem","cigs","alcohol","ppvt.imp")
covs.cat=c("bwg","female","mlt.birt","b.marry","livwho","language","whenpren","drugs","othstudy","mom.lths","mom.hs","mom.coll","mom.scoll","site1","site2","site3","site4","site5","site6","site7","site8","momblack","momhisp","momwhite","workdur.imp")
covs=c(covs.cont,covs.cat)
ncovs=length(covs)
usek = na.omit(ihdp[!(ihdp$treat==1 & ihdp$dose400==0),c("iqsb.36","dose400",covs)])
calc_att<-function(data, treat_col, out_col){
Q_cols_drop=c(out_col)
folds <- createFolds(y=data[, out_col], k=10, returnTrain = TRUE)
treat_out<-c()
preds_out<-c()
real_treat_out<-c()
for (n in 1:length(folds)){
data_train <- data[folds[[n]],]
data_test <- data[-folds[[n]],]
xt_Q <- as.matrix(data_train[,!names(data_train) %in% Q_cols_drop])
y_Q <- as.numeric(data_train[,out_col])
x_test_Q <- as.matrix(data_test[,!names(data_test) %in% Q_cols_drop])
xtest_Q0=cbind(x_test_Q)
xtest_Q1=cbind(x_test_Q)
real_treat_out <- c(real_treat_out, xtest_Q0[, treat_col])
real_treat_out <- c(real_treat_out, xtest_Q1[, treat_col])
xtest_Q0[, treat_col]=0
xtest_Q1[, treat_col]=1
x_test=rbind(xtest_Q0, xtest_Q1)
treat_out <- c(treat_out, x_test[, treat_col])
cat(dim(xt_Q), 'yy', dim(y_Q), 'zz', dim(x_test))
bart_Q.tot <- bart(x.train=xt_Q,   y.train=y_Q, x.test = x_test)
preds<-bart_Q.tot['yhat.test'][[1]]
preds<-colMeans(preds)
preds_out<-c(preds_out, preds)
}
att_df=cbind(real_treat_out, treat_out, preds_out)
att_df<-as.data.frame(att_df)
cat(dim(att_df))
att_df<-att_df[which(att_df$real_treat_out==1),]
cat(dim(att_df))
cat(head(att_df))
att<-mean(att_df[which(att_df$treat_out==1), 'preds_out']-att_df[which(att_df$treat_out==0), 'preds_out'])
sd_y<-sd(data[, out_col])
cat(att, sd_y)
}
calc_att(usek, "dose400", "iqsb.36")
View(usek)
View(usek)
library(BayesTree)
library(caret)
setwd("C:/Users/light/Dropbox (Personal)/Projects/sense_and_sensitivity/src")
load("../data/ihdp-raw/ihdp-hill-2011/data/example.data")
set.seed(3847293)
covs.cont=c("bw","momage","nnhealth","birth.o","parity","moreprem","cigs","alcohol","ppvt.imp")
covs.cat=c("bwg","female","mlt.birt","b.marry","livwho","language","whenpren","drugs","othstudy","mom.lths","mom.hs","mom.coll","mom.scoll","site1","site2","site3","site4","site5","site6","site7","site8","momblack","momhisp","momwhite","workdur.imp")
covs=c(covs.cont,covs.cat)
ncovs=length(covs)
usek = na.omit(ihdp[!(ihdp$treat==1 & ihdp$dose400==0),c("iqsb.36","dose400",covs)])
calc_att<-function(data, treat_col, out_col){
Q_cols_drop=c(out_col)
folds <- createFolds(y=data[, out_col], k=10, returnTrain = TRUE)
treat_out<-c()
preds_out<-c()
real_treat_out<-c()
for (n in 1:length(folds)){
data_train <- data[folds[[n]],]
data_test <- data[-folds[[n]],]
xt_Q <- as.matrix(data_train[,!names(data_train) %in% Q_cols_drop])
y_Q <- as.numeric(data_train[,out_col])
x_test_Q <- as.matrix(data_test[,!names(data_test) %in% Q_cols_drop])
xtest_Q0=cbind(x_test_Q)
xtest_Q1=cbind(x_test_Q)
real_treat_out <- c(real_treat_out, xtest_Q0[, treat_col])
real_treat_out <- c(real_treat_out, xtest_Q1[, treat_col])
xtest_Q0[, treat_col]=0
xtest_Q1[, treat_col]=1
x_test=rbind(xtest_Q0, xtest_Q1)
treat_out <- c(treat_out, x_test[, treat_col])
cat(dim(xt_Q), 'yy', dim(y_Q), 'zz', dim(x_test))
bart_Q.tot <- bart(x.train=xt_Q,   y.train=y_Q, x.test = x_test)
preds<-bart_Q.tot['yhat.test'][[1]]
preds<-colMeans(preds)
preds_out<-c(preds_out, preds)
}
att_df=cbind(real_treat_out, treat_out, preds_out)
att_df<-as.data.frame(att_df)
cat(dim(att_df))
att_df<-att_df[which(att_df$real_treat_out==1),]
cat(dim(att_df))
att<-mean(att_df[which(att_df$treat_out==1), 'preds_out']-att_df[which(att_df$treat_out==0), 'preds_out'])
sd_y<-sd(data[, out_col])
cat(att, sd_y)
}
calc_att(usek, "dose400", "iqsb.36")
debugSource('C:/Users/light/Dropbox (Personal)/Projects/sense_and_sensitivity/src/ihdp/ihdp-calc-att.R')
View(x_test_Q)
View(xtest_Q0)
View(xtest_Q1)
real_treat_out
View(att_df)
View(att_df)
calc_att<-function(data, treat_col, out_col){
Q_cols_drop=c(out_col)
folds <- createFolds(y=data[, out_col], k=10, returnTrain = TRUE)
treat_out<-c()
preds_out<-c()
real_treat_out<-c()
for (n in 1:length(folds)){
data_train <- data[folds[[n]],]
data_test <- data[-folds[[n]],]
xt_Q <- as.matrix(data_train[,!names(data_train) %in% Q_cols_drop])
y_Q <- as.numeric(data_train[,out_col])
x_test_Q <- as.matrix(data_test[,!names(data_test) %in% Q_cols_drop])
xtest_Q0=cbind(x_test_Q)
xtest_Q1=cbind(x_test_Q)
real_treat_out <- c(real_treat_out, xtest_Q0[, treat_col])
real_treat_out <- c(real_treat_out, xtest_Q1[, treat_col])
xtest_Q0[, treat_col]=0
xtest_Q1[, treat_col]=1
x_test=rbind(xtest_Q0, xtest_Q1)
treat_out <- c(treat_out, x_test[, treat_col])
cat(dim(xt_Q), 'yy', dim(y_Q), 'zz', dim(x_test))
bart_Q.tot <- bart(x.train=xt_Q,   y.train=y_Q, x.test = x_test)
preds<-bart_Q.tot['yhat.test'][[1]]
preds<-colMeans(preds)
preds_out<-c(preds_out, preds)
}
att_df=cbind(real_treat_out, treat_out, preds_out)
att_df<-as.data.frame(att_df)
att_df<-att_df[which(att_df$real_treat_out==1),]
att<-mean(att_df[which(att_df$treat_out==1), 'preds_out']-att_df[which(att_df$treat_out==0), 'preds_out'])
sd_y<-sd(data[, out_col])
cat(att, sd_y)
}
socioeconomic<-c('mom.lths', "mom.hs", "mom.scoll", "mom.coll", "b.marry", "livwho", "language", "momblack", "momhisp", "momwhite")
usek_min_socio<-usek[, !names(usek) %in% socioeconomic]
calc_att(usek_min_socio, "dose400", "iqsb.36")
