xrecepter | R Documentation |
wrapper for medicin macro
xrecepter(
drugdb,
adm,
atc,
window = 5,
value,
min,
max,
def,
maxdepot,
period = c("'01jan1995'd", "'31dec2015'd"),
name = "adrug",
user,
wd,
sas.program = "/usr/local/bin/sas ",
sas.switches,
sas.runner,
macro = "~/research/SoftWare/heaven/sas/medicin_macro_version_31.sas",
save.tmp = FALSE,
verbose = TRUE,
server = "doob",
remote = FALSE,
remote.home,
left_only = 1
)
drugdb |
drugdb data |
adm |
admission data |
atc |
atc kode specifying drugdb of interest |
window |
number of purchases that enter the calculations |
value |
is a vector of strengths of one unit (e.g., pill) of the drug. The vector should have one such strength for each of the different packages that occur in the data. |
min |
is a vector of the same length as |
max |
is a vector of the same length as |
def |
is a vector of the same length as |
maxdepot |
Maximum number of units that a patient can stash |
period |
Vector of two dates that SAS can eat: c("'01jan1995'd","'31dec2015'd"). Can also be numeric values: number of days since 1960-01-01. |
name |
working name of output file (only relevant when save.tmp is set) |
user |
user name on remote (unix like) machine |
wd |
working directory |
sas.program |
path to sas program |
sas.switches |
On linux this defaults to "" on any other
system to |
sas.runner |
How sas is invoked. On linux this defaults to
|
macro |
path to sas macro |
save.tmp |
if TRUE do not delete the temporary SAS files |
verbose |
like bla bla? |
server |
name of remote (unix like) machine |
remote |
if TRUE run on a remote (unix like) machine |
remote.home |
home folder on remote (unix like) machine |
left_only |
- when 1 only use prior prescription, when 0 use prior and future prescriptions. |
wrapper for medicin macro
Thomas A. Gerds <tag@biostat.ku.dk>
library(heaven)
## Not run:
library(heaven)
library(data.table)
set.seed(05021992)
N=18
packs = list("R03AK11"=list(c(10,1)))
lmdb=simPrescriptionData(N,packages=packs,max.packages=1)
lpr=simAdmissionData(N)
## very simple data
lmdb <- lmdb[c(1,4,18)]
R03 = list(atc=c("R03AK11"),
maxdepot=100,
period=as.Date(c("1995-01-01", "2012-12-31")),
prescriptionwindow=2,
doses=list(value=c(5,10),
min = c(.5,.5),
max = c(2,2),
def = c(1,1)))
xrecepter(drugdb=lmdb,adm=lpr,window=5,remote=FALSE,wd="~/tmp",save.tmp=0L,
value=rep(R03$doses$value,2),min=rep(R03$doses$min,2),max=rep(R03$doses$max,2),
def=rep(R03$doses$def,2),maxdepot=100,period=c(12784,20089),atc="R03AK11",
name="blaupill",sas.program="/usr/local/bin/sas",
verbose=FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.