Displaying 20 results from an estimated 2000 matches similar to: "bootstrap in time dependent Cox model"
2011 Sep 12
1
coxreg vs coxph: time-dependent treatment
Dear List,
After including cluster() option the coxreg (from eha package)
produces results slightly different than that of coxph (from survival)
in the following time-dependent treatment effect calculation (example
is used just to make the point). Will appreciate any explaination /
comment.
cheers,
Ehsan
############################
require(survival)
require(eha)
data(heart)
# create weights
2011 May 01
1
Longitudinal data with non-randomized subjects
Dear List,
I have a theoretical question related to epidemiological data analysis:
If the treatment status (tx = 0,1) changes over time for the patients in a non-randomized cohort, is there a way to estimate the treatment effect?
(i.e., after joining the study, some patients may have to wait for a period of time before receiving the treatment, i.e., the situation of patient with id == 2 for the
2008 Jul 17
3
Histogram with two colors depending on condition
Dear List,
Say, we generate data like this-
dat<-rnorm(1000,1,2)
hist(dat)
How do i make the histogram, say, red (col = 2) before X = dat = 0, and rest say, green (col = 3) beyond X = dat = 0 in R?
The resulting histogram could be like this http://ehsan.karim.googlepages.com/histogram.JPG (edited)
Thanks in advance.
Ehsan
http://ehsan.karim.googlepages.com/diaryofastatistician
2005 Mar 11
2
Calculating lengths of runs of 0 or 1 sequences in meteorological data
Dear List Members,
I need some help about programming in S language. My
problem is as follows:
I have meteorological data (about rainfall measurement
each day from 1989-2002), say like
http://www.angelfire.com/ab5/get5/data.rainfall.txt
or http://www.angelfire.com/ab5/get5/R.rainfall.txt
in a sequence of 0(denoting dry day)'s and 1(denoting
wet day)'s. I want to construct a frequency
2011 Jun 25
2
cluster() or frailty() in coxph
Dear List,
Can anyone please explain the difference between cluster() and
frailty() in a coxph? I am a bit puzzled about it. Would appreciate
any useful reference or direction.
cheers,
Ehsan
> marginal.model <- coxph(Surv(time, status) ~ rx + cluster(litter), rats)
> frailty.model <- coxph(Surv(time, status) ~ rx + frailty(litter), rats)
> marginal.model
Call:
coxph(formula =
2004 Apr 14
4
Non-Linear Regression Problem
Dear all,
I was wondering if there is any way i could do a "Grid Search" on a
parameter space using R (as SAS 6.12 and higher can do it) to start the
Newton-Gauss Linearization least squares method when i have NO prior
information about the parameter.
W. N. Venables and B. D. Ripley (2002) "Modern Applied Statistics with S",
4 th ed., page 216-7 has a topic
2004 Apr 05
3
Selecting Best Regression Equation
Dear all,
Does R or S-plus or any of their packages provide any command to form any
of the following procedures to find Best Regression Equation -
1. 'All Possible Regressions Procedures' (is there any automated command
to perform 2^p regressions and ordering according to criteria R2(adj),
mallows Cp, s2- by not setting all the regression models manually),
2. 'Backward
2005 Mar 20
1
"Graphics (for goodness of fit)" Question
Dear List,
Suppose, I have some observed and expected
frequencies, such as following.
I need to draw a graph where plots of observed and
expected frequencies are merged into one.
------------------------------------------------
m <- c(1,2,3,4,5,6,7,8,9,10,12,13,17)
k <- c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 19)
ExpWW <- c(0.309330628803245, 0.213645190887434,
0.147558189649435,
2008 Jan 27
2
Likelihood optimization numerically
Dear List,
I am not sure how should i optimize a log-likelihood numerically:
Here is a Text book example from Statistical Inference by George Casella, 2nd
Edition Casella and Berger, Roger L. Berger (2002, pp. 355, ex. 7.4 # 7.2.b):
data = x = c(20.0, 23.9, 20.9, 23.8, 25.0, 24.0, 21.7, 23.8, 22.8, 23.1, 23.1, 23.5, 23.0, 23.0)
n <- length(x)
# likelihood from a 2 parameter Gamma(alpha,
2004 May 06
5
Orthogonal Polynomial Regression Parameter Estimation
Dear all,
Can any one tell me how can i perform Orthogonal
Polynomial Regression parameter estimation in R?
--------------------------------------------
Here is an "Orthogonal Polynomial" Regression problem
collected from Draper, Smith(1981), page 269. Note
that only value of alpha0 (intercept term) and signs
of each estimate match with the result obtained from
coef(orth.fit). What
2004 Mar 01
3
Nonparametric test of randomness (Run Test)
Dear all,
Does R or S-plus or any of their packages provide
Non-parametric "Run test" (which tests whether a
sequence of numbers might be random or not)? If yes,
i'd like a numerical illustration of this test.
Any response / help / comment / suggestion will be
greatly appreciated. Thanks in advance.
-------------------------------
Mohammad Ehsanul Karim <wildscop at
2003 Dec 26
2
OC curve in "Quality Control"
Dear all,
Can anyone please help me about any of the following questions:
--------------------------------------------
1. How can i find "factorial" of any number in R? I tried
> prod(170:1) # to find factorial of 170 or 170!
Is it the only procedure - or R has any better process / operational
character to calculate factorial? Also, is it possible to calculate
factorial of 500? Or
2010 Nov 02
2
multi-level cox ph with time-dependent covariates
Dear all,
I would like to know if it is possible to fit in R a Cox ph model with
time-dependent covariates and to account for hierarchical effects at
the same time. Additionally, I'd like also to know if it would be
possible to perform any feature selection on this model fit.
I have a data set that is composed by multiple marker measurements
(and hundreds of covariates) at different time
2005 Jun 26
2
chisq.test using amalgamation automatically (possible ?!?)
Dear List,
If any of observed and/or expected data has less than
5 frequencies, then chisq.test (Pearson's Chi-squared
Test for Count Data from package:stats) gives warning
messages. For example,
x<-c(10, 14, 10, 11, 11, 7, 8, 4, 1, 4, 4, 2, 1, 1, 2,
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1)
y<-c(9.13112391745095, 13.1626482033341,
12.6623267638188, 11.0130706413029, 9.16415925139016,
2007 Apr 17
3
Extracting approximate Wald test (Chisq) from coxph(..frailty)
Dear List,
How do I extract the approximate Wald test for the
frailty (in the following example 17.89 value)?
What about the P-values, other Chisq, DF, se(coef) and
se2? How can they be extracted?
######################################################>
kfitm1
Call:
coxph(formula = Surv(time, status) ~ age + sex +
disease + frailty(id,
dist = "gauss"), data = kidney)
2009 Mar 26
1
Centring variables in Cox Proportional Hazards Model
Dear All,
I am contemplating centering the covariates in my Cox model to reduce
multicollinearity between the predictors and the interaction term and
to render a more meaningful interpretation of the regression
coefficient. Suppose I have two indicator variables, x1 and x2 which
represent age categories (x1 is patients less than 16 while x2 is for
patients older than 65). If I use the following
2003 Nov 17
3
S Programming
Dear all,
I am thinking of writing my own functions in s-plus (or in R). I just
know how to work with S-plus / R built-in functions. Therefore, I'm a
beginner in S programming.
I am looking for some on-line documentation that is well written about
"Programming in S language" where control stuctures / loops / vectorization
and necessery sequences of S programming are
2007 Apr 08
0
Simulation of the Frailty of the Cox PH model
Dear R-list users,
I am trying to do simulation of survival data to
enable it to run under frailty option. Below is the
function a that I am using. My questions are:
1. How do I modify it to get bigger (hopefully
significant) value of Variance of random effect?
2. What changes do I have to make in the function to
run it under correlated frailty model? (may be in
kinship package)
3. Is there
2004 Apr 16
5
Non-Linear Regression (Cobb-Douglas and C.E.S)
Dear all,
For estimating Cobb-Douglad production Function [ Y = ALPHA * (L^(BETA1)) *
(K^(BETA2)) ], i want to use nls function (without linearizing it). But
how can i get initial values?
------------------------------------
> options(prompt=" R> " )
R> Y <- c(59.6, 63.9, 73.5, 75.6, 77.3, 82.8, 83.6, 84.9, 90.3, 80.5,
73.5, 60.3, 58.2, 64.4, 75.4, 85, 92.7, 85.4,
2006 Sep 03
2
Running cox models
Hi,
I'm reading van Belle et al "Biostatistics" and trying to run a cox test using
a dataset from:
http://faculty.washington.edu/~heagerty/Books/Biostatistics/chapter16.html
(Primary Biliary Cirrhosis data link at top of the page),
I'm using the following code:
--------------- start of code
library(survival)
liver <-