Package smoothhr. November 9, 2015



Similar documents
Package survpresmooth

STATISTICA Formula Guide: Logistic Regression. Table of Contents

Regression Modeling Strategies

Adequacy of Biomath. Models. Empirical Modeling Tools. Bayesian Modeling. Model Uncertainty / Selection

Package bigdata. R topics documented: February 19, 2015

A Handbook of Statistical Analyses Using R. Brian S. Everitt and Torsten Hothorn

Flexible geoadditive survival analysis of non-hodgkin lymphoma in Peru

Package MDM. February 19, 2015

Package SurvCorr. February 26, 2015

Package neuralnet. February 20, 2015

SPSS TRAINING SESSION 3 ADVANCED TOPICS (PASW STATISTICS 17.0) Sun Li Centre for Academic Computing lsun@smu.edu.sg

Statistics in Retail Finance. Chapter 6: Behavioural models

Package empiricalfdr.deseq2

Tips for surviving the analysis of survival data. Philip Twumasi-Ankrah, PhD

Package missforest. February 20, 2015

Vignette for survrm2 package: Comparing two survival curves using the restricted mean survival time

Smoothing and Non-Parametric Regression

Example: Credit card default, we may be more interested in predicting the probabilty of a default than classifying individuals as default or not.

Package plan. R topics documented: February 20, 2015

BayesX - Software for Bayesian Inference in Structured Additive Regression

Multivariate Logistic Regression

Package polynom. R topics documented: June 24, Version 1.3-8

Package MBA. February 19, Index 7. Canopy LIDAR data

Journal of Statistical Software

Overview Classes Logistic regression (5) 19-3 Building and applying logistic regression (6) 26-3 Generalizations of logistic regression (7)

Least Squares Estimation

Package EstCRM. July 13, 2015

Package metafuse. November 7, 2015

Getting started with qplot

7 Time series analysis

sample median Sample quartiles sample deciles sample quantiles sample percentiles Exercise 1 five number summary # Create and view a sorted

SUMAN DUVVURU STAT 567 PROJECT REPORT

Regression III: Advanced Methods

Survival Analysis of Left Truncated Income Protection Insurance Data. [March 29, 2012]

# load in the files containing the methyaltion data and the source # code containing the SSRPMM functions

Linda Staub & Alexandros Gekenidis

Package dsstatsclient

Module 5: Introduction to Multilevel Modelling SPSS Practicals Chris Charlton 1 Centre for Multilevel Modelling

Package hier.part. February 20, Index 11. Goodness of Fit Measures for a Regression Hierarchy

Lab 13: Logistic Regression

ON THE DEGREES OF FREEDOM IN RICHLY PARAMETERISED MODELS

Package dsmodellingclient

Fitting Subject-specific Curves to Grouped Longitudinal Data

Cross Validation techniques in R: A brief overview of some methods, packages, and functions for assessing prediction models.

Unit 12 Logistic Regression Supplementary Chapter 14 in IPS On CD (Chap 16, 5th ed.)

Package changepoint. R topics documented: November 9, Type Package Title Methods for Changepoint Detection Version 2.

Applied Statistics. J. Blanchet and J. Wadsworth. Institute of Mathematics, Analysis, and Applications EPF Lausanne

Introduction. Survival Analysis. Censoring. Plan of Talk

Syntax Menu Description Options Remarks and examples Stored results Methods and formulas References Also see. Description

Viewing Ecological data using R graphics

exspline That: Explaining Geographic Variation in Insurance Pricing

Survey, Statistics and Psychometrics Core Research Facility University of Nebraska-Lincoln. Log-Rank Test for More Than Two Groups

Package xtal. December 29, 2015

Gamma Distribution Fitting

Package MixGHD. June 26, 2015

Semiparametric Multinomial Logit Models for the Analysis of Brand Choice Behaviour

Package ATE. R topics documented: February 19, Type Package Title Inference for Average Treatment Effects using Covariate. balancing.

STA 4273H: Statistical Machine Learning

Package cpm. July 28, 2015

Simple Linear Regression Inference

ABSTRACT INTRODUCTION

Package tagcloud. R topics documented: July 3, 2015

Package support.ces. R topics documented: August 27, Type Package

Package multivator. R topics documented: February 20, Type Package Title A multivariate emulator Version Depends R(>= 2.10.

Comparison of Survival Curves

Package support.ces. R topics documented: April 27, Type Package

5. Multiple regression

Assumptions. Assumptions of linear models. Boxplot. Data exploration. Apply to response variable. Apply to error terms from linear model

Package hoarder. June 30, 2015

SAS Syntax and Output for Data Manipulation:

Package robfilter. R topics documented: February 20, Version 4.1 Date Title Robust Time Series Filters

Package dunn.test. January 6, 2016

An Application of Weibull Analysis to Determine Failure Rates in Automotive Components

Data Mining Lab 5: Introduction to Neural Networks

NCSS Statistical Software Principal Components Regression. In ordinary least squares, the regression coefficients are estimated using the formula ( )

Developing Risk Adjustment Techniques Using the System for Assessing Health Care Quality in the

CHAPTER 13 SIMPLE LINEAR REGRESSION. Opening Example. Simple Regression. Linear Regression

Penalized Logistic Regression and Classification of Microarray Data

Package wordcloud. R topics documented: February 20, 2015

Effect Displays in R for Generalised Linear Models

Introduction to Event History Analysis DUSTIN BROWN POPULATION RESEARCH CENTER

Graphics in R. Biostatistics 615/815

Latent Class Regression Part II

The ACC 50 th Annual Scientific Session

Directions for using SPSS

Regression and Programming in R. Anja Bråthen Kristoffersen Biomedical Research Group

Model Validation Techniques

Advanced Quantitative Methods for Health Care Professionals PUBH 742 Spring 2015

Linear Models and Conjoint Analysis with Nonlinear Spline Transformations

GAM for large datasets and load forecasting

Package retrosheet. April 13, 2015

> plot(exp.btgpllm, main = "treed GP LLM,", proj = c(1)) > plot(exp.btgpllm, main = "treed GP LLM,", proj = c(2)) quantile diff (error)

Transcription:

Encoding UTF-8 Type Package Depends R (>= 2.12.0),survival,splines Package smoothhr November 9, 2015 Title Smooth Hazard Ratio Curves Taking a Reference Value Version 1.0.2 Date 2015-10-29 Author Artur Araujo and Luis Meira-Machado <lmachado@math.uminho.pt> Maintainer Artur Araujo <artur.stat@gmail.com> Provides flexible hazard ratio curves allowing non-linear relationships between continuous predictors and survival. To better understand the effects that each continuous covariate has on the outcome, results are ex pressed in terms of hazard ratio curves, taking a specific covariate value as reference. Confidence bands for these curves are also derived. License GPL (>= 2) LazyLoad yes LazyData yes NeedsCompilation no Repository CRAN Date/Publication 2015-11-09 14:55:30 R topics documented: smoothhr-package..................................... 2 dfmacox........................................... 2 plot.hr........................................... 4 predict.hr.......................................... 6 print.hr........................................... 7 smoothhr.......................................... 8 whas500........................................... 10 1

2 dfmacox Index 11 smoothhr-package Smooth Hazard Ratio Curves Taking a Reference Value Details Provides flexible hazard ratio curves allowing non-linear relationships between continuous predictors and survival. To better understand the effects that each continuous covariate has on the outcome, results are expressed in terms of hazard ratio curves, taking a specific covariate value as reference. Confidence bands for these curves are also derived. Package: smoothhr Type: Package Version: 1.0.2 Date: 2015-10-29 License: GPL (>= 2) LazyLoad: yes LazyData: yes Artur Araújo and Luís Meira-Machado <lmachado@math.uminho.pt> Maintainer: Artur Araújo <artur.stat@gmail.com> Carmen Cadarso-Suarez, Luis Meira-Machado, Thomas Kneib and Francisco Gude. Flexible hazard ratio curves for continuous predictors in multi-state models: a P-spline approach. Statistical Modelling, 2010, 10:291-314. dfmacox Degrees of freedom in multivariate additive Cox models Provides the degrees of freedom for flexible continuous covariates in multivariate additive Cox models.

dfmacox 3 dfmacox(time, time2=null, status, nl.predictors, other.predictors, smoother, method, mindf=null, maxdf=null, ntimes=null, data) Arguments Value time time2 status For right censored data, this is the follow up time. For interval data, the first argument is the starting time for the interval. Ending time of the interval for interval censored or counting process data only. Intervals are assumed to be open on the left and closed on the right, (start, end]. For counting process data, event indicates whether an event occurred at the end of the interval. The status indicator, normally 0=alive, 1=dead. Other choices are TRUE/FALSE (TRUE = death) or 1/2 (2=death). For interval censored data, the status indicator is 0=right censored, 1=event at time, 2=left censored, 3=interval censored. Although unusual, the event indicator can be omitted, in which case all subjects are assumed to have an event. nl.predictors Vector with covariates to be introduced in the additive Cox model with a nonlinear effect. other.predictors Vector with remaining covariates to be introduced in the additive Cox model. This will include qualitative covariates or continuous covariates with a linear effect. smoother method mindf maxdf ntimes data Smoothing method to be used in the additive Cox model. Possible options are ns for natural spline smoothing or pspline for penalized spline smoothing. The desired method to obtain the optimal degrees of freedom. If method ="AIC", then the AIC = (loglik -df) is used to choose the "optimal" degrees of freedom. The corrected AIC of Hurvich et. al. (method="aicc") and the BIC criterion (method = "BIC") can also be used. Vector with minimum degrees of freedom for each nonlinear predictor. By default this value is a vector of of the same length of nl.predictors all with value 1, if smoother is ns ; a vector with the same length of nl.predictors all with value 1.5, if smoother is pspline. Vector with maximum degrees of freedom for each nonlinear predictor. By default, when penalized spline is used (smoother= pspline ), the corrected AIC from Hurvich obtained in the corresponding univariate additive Cox model is used. When penalized spline is used (smoother= ns ) a vector with the same length of nl.predictors all with values 1.5. Internel procedure which involves repetion of some convergence steps to attain the optimal degrees of freedom. By deafault is 5. A data.frame in which to interpret the variables named in the arguments time, time2, and status. An object of class list, basically a list including the elements:

4 plot.hr df AIC AICc BIC myfit method nl.predictors Degrees of freedom of the nl.predictors. Akaike s Information Criterion score of the fitted model. Corrected Akaike s Information Criterion score of the fitted model. Bayesian Information Criterion score of the fitted model. Fitted (additive Cox) model based on the chosen degrees of freedom. The method used for obtaining the degrees of freedom. Vector with the nonlinear predictors. Artur Araújo and Luís Meira-Machado Eilers, Paul H. and Marx, Brian D. (1996). Flexible smoothing with B-splines and penalties. Statistical Science, 11, 89-121. Hurvich, C.M. and Simonoff, J.S. and Tsai, Chih-Ling (1998). Smoothing parameter selection in nonparametric regression using an improved Akaike information criterion, JRSSB, volume 60, 271 293. # Example 1 library(survival) mydf_ns <- dfmacox(time="lenfol", status="fstat", nl.predictors=c("los", "bmi"), other.predictors=c("age", "hr", "gender", "diasbp"), smoother="ns", data=whas500) print(mydf_ns) # Example 2 mydf_ps <- dfmacox(time="lenfol", status="fstat", nl.predictors=c("los", "bmi"), other.predictors=c("age", "hr", "gender", "diasbp"), smoother="pspline", data=whas500) print(mydf_ps) plot.hr Flexible hazard ratio curves taking a specific covariate value as reference Plots flexible hazard ratio curves allowing non-linear relationships between continuous predictors and survival. To better understand the effects that each continuous covariate has on the outcome, results are expressed in terms of hazard ratio curves, taking a specific covariate value as reference. Confidence bands for these curves are also derived.

plot.hr 5 ## S3 method for class HR plot(x, predictor, prob=null, pred.value=null, conf.level=0.95, round.x=null, ref.label=null, col, main, xlab, ylab, lty, xlim, ylim, xx,...) Arguments x predictor prob pred.value An object of class HR Variable named in the formula or included as a predictor in the coxfit. Usually a continuous predictor of survival for which the results are expressed in terms of hazard ratio curves, taking a specific covariate value as reference. Value between 0 and 1. If prob=0 the reference value will be the minimum of the hazard ratio curve. If prob=1 the reference value will be the maximum of the hazard ratio curve. For values between 0 and 1 the reference value will be the corresponding quantile of the variable predictor. Value from the variable predictor to be taken as the reference value. conf.level Level of confidence. Defaults to 0.95 (corresponding to 95%). round.x ref.label col main xlab ylab lty xlim ylim xx Rounding of numbers in the plot.... Other arguments. Label for the reference covariate. By default is the name of the covariate. Vector of dimension 3 for the colors to plot. These arguments to title have useful defaults here. The range of x and y values with sensible defaults. The range of x and y values with sensible defaults. Vector of dimension 2 for the line type. The range of x and y values with sensible defaults. The range of x and y values with sensible defaults. Vector of values (from the variable predictor) to be shown in the x axis. Value No value is returned. Artur Araújo and Luís Meira-Machado Carmen Cadarso-Suarez, Luis Meira-Machado, Thomas Kneib and Francisco Gude. Flexible hazard ratio curves for continuous predictors in multi-state models: a P-spline approach. Statistical Modelling, 2010, 10:291-314

6 predict.hr See Also smoothhr. # Example 1 library(survival) fit <- coxph(surv(lenfol, fstat)~age+hr+gender+diasbp+pspline(bmi)+pspline(los), data=whas500, x=true) hr1 <- smoothhr(data=whas500, coxfit=fit) plot(hr1, predictor="bmi", prob=0, conf.level=0.95) # Example 2 hr2 <- smoothhr( data=whas500, time="lenfol", status="fstat", formula=~age+hr+gender+diasbp+ pspline(bmi)+pspline(los) ) plot(hr2, predictor="los", pred.value=7, conf.level=0.95, xlim=c(0,30), round.x=1, ref.label="ref.", xaxt="n") xx <- c(0, 5, 10, 15, 20, 25, 30) axis(1, xx) predict.hr predict method for an object of class HR. predict method for an object of class HR. ## S3 method for class HR predict(object, predictor, prob=null, pred.value=null, conf.level=0.95, prediction.values=null, round.x=null, ref.label=null,...) Arguments object predictor prob pred.value An object of class HR. Variable named in the formula or included as a predictor in the coxfit. Usually a continuous predictor of survival for which the results are expressed in terms of hazard ratio curves, taking a specific covariate value as reference. Value between 0 and 1. If prob=0 the reference value will be the minimum of the hazard ratio curve. If prob=1 the reference value will be the maximum of the hazard ratio curve. For values between 0 and 1 the reference value will be the corresponding quantile of the variable predictor. Value from the variable predictor to be taken as the reference value. conf.level Level of confidence. Defaults to 0.95 (corresponding to 95%).

print.hr 7 Value prediction.values Vector of values ranging between minimum and maximum of the variable predictor. round.x ref.label... Other arguments. Rounding of numbers in the predict. Label for the reference covariate. By default is the name of the covariate. Returns a matrix with the prediction values. Artur Araújo and Luís Meira-Machado Carmen Cadarso-Suarez, Luis Meira-Machado, Thomas Kneib and Francisco Gude. Flexible hazard ratio curves for continuous predictors in multi-state models: a P-spline approach. Statistical Modelling, 2010, 10:291-314. See Also smoothhr. # Example 1 library(survival) fit <- coxph(surv(lenfol, fstat)~age+hr+gender+diasbp+pspline(bmi)+pspline(los), data=whas500, x=true) hr1 <- smoothhr(data=whas500, coxfit=fit) predict(hr1, predictor="bmi", prob=0, conf.level=0.95) # Example 2 hr2 <- smoothhr( data=whas500, time="lenfol", status="fstat", formula=~age+hr+gender+diasbp+ pspline(bmi)+pspline(los) ) pdval <- c(1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 15, 18, 22, 25) predict(hr2, predictor="los", pred.value=7, conf.level=0.95, prediction.values=pdval, ref.label="ref.") print.hr print method for a Smooth Hazard Ratio Object This class of objects is returned by the HR class of functions to represent smooth hazard ratio curve. Objects of this class have methods for print, predict and plot.

8 smoothhr ## S3 method for class HR print(x,...) Arguments x An object of class HR.... Other arguments. Value No value is returned. Artur Araújo and Luís Meira-Machado See Also smoothhr. # Example 1 library(survival) fit <- coxph(surv(lenfol, fstat)~age+hr+gender+diasbp+pspline(bmi)+pspline(los), data=whas500, x=true) hr1 <- smoothhr(data=whas500, coxfit=fit) print(hr1) # Example 2 hr2 <- smoothhr( data=whas500, time="lenfol", status="fstat", formula=~age+hr+gender+diasbp+ pspline(bmi)+pspline(los) ) print(hr2) smoothhr Smooth Hazard Ratio Curves Taking a Reference Value Provides flexible hazard ratio curves allowing non-linear relationships between continuous predictors and survival. To better understand the effects that each continuous covariate has on the outcome, results are expressed in terms of hazard ratio curves, taking a specific covariate value as reference. Confidence bands for these curves are also derived.

smoothhr 9 smoothhr(data, time=null, time2=null, status=null, formula=null, coxfit, status.event=null) Arguments data time time2 status formula coxfit status.event A data.frame in which to interpret the variables named in the formula or in the arguments time, time2, status and coxfit. For right censored data, this is the follow up time. For interval data, the first argument is the starting time for the interval. Ending time of the interval for interval censored or counting process data only. Intervals are assumed to be open on the left and closed on the right, (start, end]. For counting process data, event indicates whether an event occurred at the end of the interval. The status indicator, normally 0=alive, 1=dead. Other choices are TRUE/FALSE (TRUE = death) or 1/2 (2=death). For interval censored data, the status indicator is 0=right censored, 1=event at time, 2=left censored, 3=interval censored. Although unusual, the event indicator can be omitted, in which case all subjects are assumed to have an event. A formula object, with the terms on the right after the ~ operator. An object of class coxph. This argument is optional, being an alternative to the arguments time, time2, status and formula. The status indicator is a qualitative variable where usually the highest value is left for the event of interest (usually 0=alive, 1=dead). If that is not the case the status.event indicates which value denotes the event of interest. Value An object of class HR. There are methods for print, predict and plot. HR objects are implemented as a list with elements: dataset coxfit phtest Dataset used. The object of class coxph used. Result from testing the proportional hazards assumption. Artur Araújo and Luís Meira-Machado Carmen Cadarso-Suarez, Luís Meira-Machado, Thomas Kneib and Francisco Gude. Flexible hazard ratio curves for continuous predictors in multi-state models: a P-spline approach. Statistical Modelling, 2010, 10:291-314.

10 whas500 # Example 1 library(survival) fit <- coxph(surv(lenfol, fstat)~age+hr+gender+diasbp+pspline(bmi)+pspline(los), data=whas500, x=true) hr1 <- smoothhr(data=whas500, coxfit=fit) print(hr1) # Example 2 hr2 <- smoothhr( data=whas500, time="lenfol", status="fstat", formula=~age+hr+gender+diasbp+ pspline(bmi)+pspline(los) ) print(hr2) whas500 Worcester Heart Attack Study WHAS500 Data Format Details Source Data from the Worcester Heart Attack Study A data frame with 500 observations with 22 variables. Data from the Worcester Heart Attack Study whose main goal was to describe factors associated with trends over time in the incidence and survival rates following hospital admission for acute myocardial infarction. Worcester Heart Attack Study data from Dr. Robert J. Goldberg of the Department of Cardiology at the University of Massachusetts Medical School. This data is also available at the following Wiley s FTP site: ftp://ftp.wiley.com/public/sci_tech_med/survival Hosmer, D.W. and Lemeshow, S. and May, S. (2008) Applied Survival Analysis: Regression Modeling of Time to Event Data: Second Edition, John Wiley and Sons Inc., New York, NY

Index Topic datasets whas500, 10 Topic hplot plot.hr, 4 Topic methods plot.hr, 4 predict.hr, 6 print.hr, 7 Topic models dfmacox, 2 smoothhr, 8 Topic package smoothhr-package, 2 Topic print print.hr, 7 Topic regression dfmacox, 2 smoothhr, 8 Topic survival dfmacox, 2 plot.hr, 4 predict.hr, 6 print.hr, 7 smoothhr, 8 dfmacox, 2 plot.hr, 4 predict.hr, 6 print.hr, 7 smoothhr, 6 8, 8 smoothhr-package, 2 whas500, 10 11