date.mdy {survival}R Documentation

Convert from Julian Dates to Month, Day, and Year

Description

Convert a vector of Julian dates to a list of vectors with the corresponding values of month, day and year, and optionally weekday.

Usage

date.mdy(sdate, weekday = FALSE)

Arguments

sdate a Julian date value, as returned by mdy.date(), number of days since 1/1/1960.
weekday if TRUE, then the returned list also will contain the day of the week (Sunday=1, Saturday=7).

Value

A list with components month, day, and year.

References

Press, W. H., Teukolsky, S. A., Vetterling, W. T., and Flannery, B. P. (1992). Numerical Recipes: The Art of Scientific Computing (Second Edition). Cambridge University Press.

Examples

day <- 7
temp <- date.mdy(mdy.date(month = 7, day = day, year = 1960))
## Check for illegal dates, such as 29 Feb in a non leap year
if (temp$day != day) {
  cat("Some illegal dates\n")
} else {
  cat("All days are legal\n")
}

[Package survival version 2.29 Index]
./usr/lib/R/library/survival/html/ridge.html0000644000000000000000000000510310507322246017734 0ustar rootroot R: Ridge regression
ridge {survival}R Documentation

Ridge regression

Description

When used in a coxph or survreg model formula, specifies a ridge regression term. The likelihood is penalised by theta/2 time the sum of squared coefficients. If scale=T the penalty is calculated for coefficients based on rescaling the predictors to have unit variance. If df is specified then theta is chosen based on an approximate degrees of freedom.

Usage

ridge(..., theta, df=nvar/2, eps=0.1, scale=TRUE)

Arguments

... predictors to be ridged
theta penalty is theta/2 time sum of squared coefficients
df Approximate degrees of freedom
eps Accuracy required for df
scale Scale variables before applying penalty?

Value

An object of class coxph.penalty containing the data and control functions.

References

Gray (1992) "Flexible methods of analysing survival data using splines, with applications to breast cancer prognosis" JASA 87:942–951

See Also

coxph,survreg,pspline,frailty

Examples


fit1 <- coxph(Surv(futime, fustat) ~ rx + ridge(age, ecog.ps, theta=1),
              ovarian)
fit1

lfit0 <- survreg(Surv(time, status) ~1, cancer)
lfit1 <- survreg(Surv(time, status) ~ age + ridge(ph.ecog, theta=5), cancer)
lfit2 <- survreg(Surv(time, status) ~ sex + ridge(age, ph.ecog, theta=1), cancer)
lfit3 <- survreg(Surv(time, status) ~ sex + age + ph.ecog, cancer)

lfit0
lfit1
lfit2
lfit3

[Package survival version 2.29 Index]
./usr/lib/R/library/survival/html/survdiff.html0000644000000000000000000001130710507322246020475 0ustar rootroot R: Test Survival Curve Differences
survdiff {survival}R Documentation

Test Survival Curve Differences

Description

Tests if there is a difference between two or more survival curves using the G-rho family of tests, or for a single curve against a known alternative.

Usage

survdiff(formula, data, subset, na.action, rho=0)

Arguments