VDCgenAnalysis {VDCutil}R Documentation

A generalized analysis framework used by the VDC system

Description

This runs a statisical analysis through Zelig and summarizes the results as html output. Options include simulation results, sensitivity analysis, and plots.

Usage

VDCgenAnalysis(
      formula,model,data, by=NULL,                 
      setxArgs=NULL, setx2Args=NULL, simArgs=NULL,zeligArgs=NULL, 
      sensitivityArgs=list("ptb.s"=sensitivityQ),
      HTMLInitArgs=list(Title="VDC Analysis"),
      HTMLbodyHeading = HTMLInitArgs$Title,
      HTMLnote= "<em>The following are the results of your requested analysis.</em>",
      naMethod="exclude",                            
      sensitivityQ=NULL,
      outDir=tempdir(),                           
      wantSummary=T,wantPlots=F,wantSensitivity=F,wantSim=F,
      wantBinOutput=F,    
      debug=F)     

Arguments

formula formula to be passed to Zelig
model model to be passed to Zelig
data data for analysis, passed to Zelig
by strata, passed to Zelig
setxArgs argument list to pass to setx
setx2Args argument list, if present, setx is called a second time
simArgs argument list, passed to sim
zeligArgs argument list, passed to zelig, which in turn passes any non-zelig arguments to the model function itself
sensitivityArgs argument list, passed to pzelig
HTMLInitArgs argument list, passed to HTMLInitFile
HTMLbodyHeading mainh heading for html page
HTMLnote note text below main heading
naMethod if omit na.omit is used , if exclude na.exclude is used
sensitivityQ q-value passed to sensitivity analysis
outDir directory in which to create output files
wantSummary Flag, summary output wanted
wantPlots Flag, plot output wanted
wantSensitivity Flag, sensitivity analysis wanted
wantSim Flag, simulation output wanted
wantBinOutput Flag, binary output wanted, in addition to html
debug debugging flag

Value

The paths to html index file and the binary save file.

Note

Only formula, model and data are required. Everything else can be defaulted. And in the formula if you use list() to enclose multiple outcome variables the appropriate zelig special will automatically be supplied.

VDCxtabs will call recodeVDCdf to apply VDC metadata attributes for labels, and missing v alues.

Author(s)

Micah Altman vdc-dev@latte.harvard.edu http://thedata.org

See Also

hplot, HTML, pzelig, zelig,

Examples

# using required fields and defaults, output will be summary html
VDCgenAnalysis(Employed~Year,"ls",longley)

# shows additional output options, passing arguments to sim() 
# and through zeligArgs to lm()

# should be Employed~. but Zelig 2.52 currently has a bug in setx wrt to dots
VDCgenAnalysis(Employed~GNP.deflator+GNP+Unemployed+Armed.Forces+Population+Year,"ls",longley,   
        wantPlots=TRUE,  wantSim=TRUE, wantBinOutput=TRUE, wantSensitivity=TRUE,
        naMethod="omit",
        sensitivityQ=0.95,
        simArgs = list(num=c(2000,200)),
        setxArgs = list(Year=1970),
        setx2Args = list(Year=1990),
        zeligArgs = list(singular.ok=TRUE)
        )


[Package VDCutil version 1.15 Index]