Skip to content
Snippets Groups Projects
Commit b6e39fea authored by Maximilian Schmidt's avatar Maximilian Schmidt
Browse files

Remove R code for now because of outstanding permission for bbalt.R script

parent b466a8c6
No related branches found
No related tags found
1 merge request!1Add all necessary files for the multi-area model
library('aod')
source(paste(Sys.getenv('HOME'),'/model-june/data_multi_area/bbAlt.R', sep=""))
f <- file(paste(Sys.getenv('HOME'),'/model-june/data_multi_area/raw_data/RData_prepared_logdensities.txt', sep=""),'r')
x <- read.table(f)
close(f)
dens <- data.matrix(x)[,7]
m2.bb <- betabin(cbind(S, I) ~ dens , ~ 1, data = x, "probit", control = list(maxit = 100000))
h2.bb <- c(coef(m2.bb))
print(h2.bb)
...@@ -1328,16 +1328,11 @@ def process_raw_data(): ...@@ -1328,16 +1328,11 @@ def process_raw_data():
return res return res
# Call R script to perform SLN fit # Call R script to perform SLN fit
try: print("We currently cannot publish the R code because of "
proc = subprocess.Popen(["Rscript", "copyright issues, there taking hard-coded fit parameters. "
os.path.join(basepath, 'SLN_logdensities.R')], "See Schmidt et al. (2018) for a full explanation "
stdout=subprocess.PIPE) "of the procedure.")
out = proc.communicate()[0].decode('utf-8') R_fit = [-0.1516142, -1.5343200]
R_fit = [float(out.split('\n')[1].split(' ')[1]),
float(out.split('\n')[1].split(' ')[3])]
except OSError:
print("No R installation, taking hard-coded fit parameters.")
R_fit = [-0.1516142, -1.5343200]
""" """
4. Fill missing data with fitted values. 4. Fill missing data with fitted values.
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment