DOC PREVIEW
UI STAT 5400 - R packages

This preview shows page 1 out of 4 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

122S:166Computing in StatisticsR packagesLecture 7September 13, 2006Kate Cowles374 SH, [email protected] packages• packages contain all R functions and datasets• contents of package become available in Rwhen package is loaded• search() lists displays packages currentlyloaded> search()[1] ".GlobalEnv" "package:methods" "package:stats"[4] "package:graphics" "package:grDevices" "package:utils"[7] "package:datasets" "Autoloads" "package:base"• library() displays names of packages in-stalled (but not necessarily loaded) at site> library()Packages in library ’/group/statsoft/Rlibs64’:abind Combine multi-dimensional arraysAnalyzeFMRI Functions for analysis of fMRI datasets storedin the ANALYZE format.boa Bayesian Output Analysis Program (BOA) forMCMCcar Companion to Applied Regressioncat Analysis of categorical-variable datasets withmissing valuescoda Output analysis and diagnostics for MCMC3dopt ** No title available (pre-2.0.0 install?) **e1071 Misc Functions of the Department of Statistics...SuppDists Supplementary distributionssurvrec Survival analysis for recurrent event datatkrplot TK Rplottree Classification and regression treestripack Triangulation of irregularly spaced datatseries Time series analysis and computational financextable Export tables to LaTeX or HTMLPackages in library ’/usr/lib64/R/library’:base The R Base Packageboot Bootstrap R (S-Plus) Functions (Canty)class Functions for Classificationcluster Cluster Analysis Extended Rousseeuw et al.datasets The R Datasets Packageforeign Read Data Stored by Minitab, S, SAS, SPSS,...splines Regression Spline Functions and Classesstats The R Stats Packagestats4 Statistical Functions using S4 Classessurvival Survival analysis, including penalisedlikelihood.tcltk Tcl/Tk Interfacetools Tools for Package Developmentutils The R Utils PackageStata, Systat, dBase, ...4• library( <package name> ) loads pack-age> library(survival)Loading required package: splines> search()[1] ".GlobalEnv" "package:survival" "package:splines"[4] "package:methods" "package:stats" "package:graphics"[7] "package:grDevices" "package:utils" "package:datasets"[10] "Autoloads" "package:base"• standard or base packages are considered partof R; available automatically5Contributed R packages• hundreds of contributed packages written byauthors all over the world– e.g. Luke Tierney and Jun Yan from UIstats dept!• recommended packages come in binary dis-tribution of R• most available from Comprehensive R ArchiveNetwork (CRAN)www.cran.r-project.org6Using R packages> help(package="survival")Information on package ’survival’Description:Title: Survival analysis, including penalised likelihood.Maintainer: Thomas Lumley <[email protected]>Priority: recommendedPackage: survivalVersion: 2.26Depends: stats, utils, graphics, splines, R (>= 2.0.0)LazyData: YesLazyLoad: YesAuthor: S original by Terry Therneau, ported by Thomas LumleyDescription: survival analysis: descriptive statistics, two-sampletests, parametric accelerated failure models, Cox model.Delayed entry (truncation) allowed for all models;interval censoring for parametric models. Case-cohortdesigns.License: GPL2Packaged: Fri May 19 11:27:43 2006; tlumleyBuilt: R 2.3.1; x86_64-redhat-linux-gnu; 2006-06-23 12:53:09;unixIndex:Surv Package a survival variableclogit Conditional logistic regressioncluster Identify clusters.cox.zph Test the proportional hazards assumption of a Cox regression.7coxph Proportional Hazards Regressioncoxph.detail Details of a cox model fitcoxph.object Proportional Hazards Regression Objectcoxph.rvar Robust variance for a Cox modelfrailty Frailty models by penalised likelihoodis.ratetable Verify that an object is of class ratetable.lines.survfit Add lines to a survival plotplot.cox.zph Graphical test of proportional hazards (requires splines)plot.survfit Plot method for survfit.print.survfit Short summary of a survival curvepspline Penalised (smoothing) splinespyears Person Yearsresiduals.coxph Calculate residuals for a coxph fit.residuals.survreg Compute Residuals for survreg Objectsridge ridge regressionstrata Identify strata variables.summary.survfit Print a Survival Curvesurvdiff Test Survival Curve Differencessurvexp Compute Expected Survivalsurvexp.fit Compute expected survivalsurvexp.usr Mortality tables for US and some states (requires date)survfit Compute a survival Curve for Censored Datasurvfit.object Survival Curve Objectsurvobrien O’Brien’s test for association of a variable with survivalsurvreg Regression for a parametric survival modelsurvreg.object Parametric Survival Model ObjectsurvSplit Split data for creating time-dependent covariates.anova.survreg ANOVA tables for survreg objectsuntangle.specials Help process the ’specials’ argument of the terms function.-------- date functions --------------as.date Coerce Data to Datesdate.ddmmmyy Format a Julian datedate.mdy Convert from Julian Dates to Month, Day, and8Yeardate.mmddyy Format a Julian datedate.mmddyyyy Format a Julian datedate.object Date Objectsmdy.date Convert to Julian Dates(END)Enterq()to exit the “help”9Using functions in R packages> help(survreg, package="survival")survreg package:survival R DocumentationRegression for a Parametric Survival ModelDescription:Regression for a parametric survival model. These are alltime-transformed location models, with the most useful case beingthe accelerated failure models that use a log transformation.Usage:survreg(formula=formula(data), data=parent.frame(), weights,subset,na.action,dist="weibull", init=NULL, scale=0,control=survreg.control(),parms=NULL,model=FALSE, x=FALSE,y=TRUE, robust=FALSE, ...)Arguments:formula: a formula expression as for other regression models. See thedocumentation for ’lm’ and ’formula’ for details.data: optional data frame in which to interpret the variablesweights: Optional observation weightssubset: subset of the observations to be used in the fit.na.action: function to be used to handle any NAs in the data.10dist: assumed distribution for y variable. If the argument is acharacter string, then it is assumed to name an element from’survreg.distributions’. These include ’"weibull"’,’"exponential"’, ’"gaussian"’, ’"logistic"’, ’"lognormal"’and ’"loglogistic"’. Otherwise, it is assumed to be a userdefined list conforming to the format described in’survreg.distributions’.parms: a list of fixed parameters. For the t-distribution forinstance this is the


View Full Document

UI STAT 5400 - R packages

Documents in this Course
Load more
Download R packages
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view R packages and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view R packages 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?