bj {Design}R Documentation

Buckley-James Multiple Regression Model

Description

bj fits the Buckley-James distribution-free least squares multiple regression model to a possibly right-censored response variable. This model reduces to ordinary least squares if there is no censoring. By default, model fitting is done after taking logs of the response variable. bj uses the Design class for automatic anova, fastbw, validate, Function, nomogram, summary, plot, bootcov, and other functions. The bootcov function may be worth using with bj fits, as the properties of the Buckley-James covariance matrix estimator are not fully known for strange censoring patterns.

The residuals.bj function exists mainly to compute residuals and to censor them (i.e., return them as Surv objects) just as the original failure time variable was censored. These residuals are useful for checking to see if the model also satisfies certain distributional assumptions. To get these residuals, the fit must have specified y=TRUE.

The bjplot function is a special plotting function for objects created by bj with x=TRUE, y=TRUE in effect. It produces three scatterplots for every covariate in the model: the first plots the original situation, where censored data are distingushed from non-censored data by a different plotting symbol. In the second plot, called a renovated plot, vertical lines show how censored data were changed by the procte<0000644000000000000000000000476310767032220020451 0ustar rootroot R: Total and Partial Matrix Inversion using Gauss-Jordan Sweep Operator
matinv {Design}R Documentation

Total and Partial Matrix Inversion using Gauss-Jordan Sweep Operator

Description

This function inverts or partially inverts a matrix using pivoting (the sweep operator). It is useful for sequential model-building.

Usage

matinv(a, which, negate=TRUE, eps=1e-12)

Arguments

a square matrix to invert or partially invert. May have been inverted or partially inverted previously by matinv, in which case its "swept" attribute is updated. Will un-invert if already inverted.
which vector of column/row numbers in a to invert. Default is all, for total inverse.
negate So that the algorithm can keep track of which pivots have been swept as well as roundoff errors, it actually returns the negative of the inverse or partial inverse. By default, these elements are negated to give the usual expected result. Set negate=FALSE if you will be passing the result right back into matinv, otherwise, negate the submatrix before sending back to matinv.
eps singularity criterion

Value

a square matrix, with attributes "rank" and "swept".

References

Clarke MRB (1982). Algorithm AS 178: The Gauss-Jordan sweep operator with detection of collinearity. Appl Statist 31:166–9.

Ridout MS, Cobb JM (1986). Algorithm AS R78 : A remark on algorithm AS 178: The Gauss-Jordan sweep operator with detection of collinearity. Appl Statist 38:420–2.

See Also

lrm, solve

Examples

a      <- diag(1:3)
a.inv1 <- matinv(a, 1, negate=FALSE)         #Invert with respect to a[1,1]
a.inv1
a.inv  <- -matinv(a.inv1, 2:3, negate=FALSE) #Finish the job
a.inv
solve(a)

[Package Design version 2.1-1 Index]
./usr/lib/R/site-library/Design/html/latex.cph.html0000644000000000000000000001040210767032200021022 0ustar rootroot R: LaTeX Representation of a Fitted Cox Model
latex.cph {Design}R Documentation

LaTeX Representation of a Fitted Cox Model

Description

Creates a file containing a LaTeX representation of the fitted model.

Usage

## S3 method for class 'cph':
latex(object, title,
      file=paste(first.word(deparse(substitute(object))),".tex",sep=""),
      append=FALSE, surv=TRUE, maxt=FALSE, which=NULL, varnames, columns=65, 
      inline=FALSE, before=if(inline)"" else "& &", dec=3,
      pretrans=TRUE, caption, ...) # for cph fit

## S3 method for class 'lrm':
latex(object, title, file, append, which, varnames,
columns, inline, before, pretrans, caption, ...) # for lrm fit

## S3 method for class 'ols':
latex(object, title, file, append, which, varnames,
columns, inline, before, pretrans, caption, ...) # ols fit

## S3 method for class 'pphsm':
latex(object, title, file, append, which=NULL, varnames,
columns, inline, before, pretrans, caption, ...) # pphsm fit

## S3 method for class 'psm':
latex(object, title, file, append, which=NULL, varnames,
columns, inline, before, pretrans, caption, ...) # psm fit

Arguments

object a fit object created by a Design fitting function.
title ignored
file
append see latex.default
surv if surv=TRUE was specified to cph, the underlying survival probabilities from object$surv.summary will be placed in a table unless surv=FALSE.
maxt if the maximum follow-up time in the data (object$maxtime) exceeds the last entry in object$surv.summary, underlying survival estimates at object$maxtime will be added to the table if maxt=TRUE.
which
varnames
columns
inline
before
dec
pretrans see latex.default
caption a character string specifying a title for the equation to be centered and typeset in bold face. Default is no title.
... ignored

Value

the name of the created file, with class c("latex","file"). This object works with latex viewing and printing commands in Hmisc.

Author(s)

Frank Harrell
Department of Biostatistics, Vanderbilt University
f.harrell@vanderbilt.edu

See Also

latex.Design, rcspline.restate, latex.default

Examples

## Not run: 
units(ftime) <- "Day"
f <- cph(Surv(ftime, death) ~ rcs(age)+sex, surv=TRUE, time.inc=60)
w <- latex(f)  #Interprets fitted model and makes table of S0(t)
               #for t=0,60,120,180,...   Creates file f.tex
w              #displays image, if viewer installed
latex(f,file="")   # send LaTeX code to the screen
## End(Not run)

[Package Design version 2.1-1 Index]
./usr/lib/R/site-library/Design/html/Function.html0000644000000000000000000001121710767031771020742 0ustar rootroot R: Compose an S Function to Compute X beta from a Fit
Function {Design}R Documentation

Compose an S Function to Compute X beta from a Fit

Description

Function is a class of functions for creating other S functions. Function.Design is the method for creating S functions to compute X beta, based on a model fitted with Design in effect. Like latex.Design, Function.Design simplifies restricted cubic spline functions and factors out terms in second-order interactions. Function.Design will not work for models that have third-order interactions involving restricted cubic splines. Function.cph is a particular method for handling fits from cph, for which an intercept (the negative of the centering constant) is added to the model. sascode is a function that takes an S function such as one created by Function and does most of the editing to turn the function definition into a fragment of SAS code for computing X beta from the fitted model, along with assignment statements that initialize predictors to reference values.

Usage

## S3 method for class 'Design':
Function(object, intercept=NULL, digits=max(8,
.Options$digits), ...)
## S3 method for class 'cph':
Function(object, intercept=-object$center, ...)

# Use result as fun(predictor1=value1, predictor2=value2, ...)

sascode(object, file='', append=FALSE)

Arguments

object a fit created with Design in effect
intercept an intercept value to use (not allowed to be specified to Funct