Displaying 20 results from an estimated 4000 matches similar to: "variance explained in a cox ph model"
2012 Feb 23
1
Schoenfeld residuals for a null model coxph
Hi,
I have a coxph model like
coxph(Surv(start, stop, censor) ~ x + y, mydata)
I would like to calculate the Schoenfeld residuals for the null, i.e the same model where the beta hat vector (in practical terms, the coeff vector spat out by summary()) is constrained to be all 0s --all lese stays the same.
I could calculate it by hand, but I was wondering if there is a way of doing it with
2011 Dec 05
2
barplot ignoring col parameter
Hi All,
I'm having a problem with barplot:
mydata
[1,] 2 108 0 0 0 1 3 0 0 0 0 0 7 18 3 4 8 20 26 20 19 7 1 1
mycol = c(rep('yellow', 2), rep('white', 3), rep('orange',2), rep('white', 5), rep('orange',3), rep('red',9))
barplot(mydata, col = mycol)
gives me an uniformly yellow barplot. How do I solve this?
bw
Federico
2012 Aug 15
1
hidden for() loop subsetting a matrix?
Hi,
I am subsetting a matrix thus:
test
[,1] [,2] [,3]
[1,] 1 7 13
[2,] 2 8 14
[3,] 3 9 15
[4,] 4 10 16
[5,] 5 11 17
[6,] 6 12 18
test[cbind(c(1,3,5), c(2,1,3))]
[1] 7 3 17
This works fine, and is the equivalent of c(test[1,2], test[3,1], test[5,3]). cbind(c(1,3,5), c(2,1,3)) would obviously look like:
[,1] [,2]
[1,] 1 2
[2,]
2012 Jan 28
3
logical subsetting, indexes and NAs
Dear All,
just a quick example:
> x = 1:25
> x[12] = NA
> x
[1] 1 2 3 4 5 6 7 8 9 10 11 NA 13 14 15 16 17 18 19 20 21 22 23 24 25
> y = x[x<10]
> y
[1] 1 2 3 4 5 6 7 8 9 NA
Is there any way of NOT getting NA for y = x[x<10]? Similarly
> y = x[x<15]
> y
[1] 1 2 3 4 5 6 7 8 9 10 11 NA 13 14
How do I get rid of the NA (not post
2013 Jan 07
1
checker/chequer board pattern as a colour
Hi All,
is there a reasonably simple way of using a black and white chequer/checker board pattern as a colour:
barplot(mydata, col = c('red', 'blue' 'checkerboard'))
?
BW
F
--
Federico C. F. Calboli
Neuroepidemiology and Ageing Research
Imperial College, St. Mary's Campus
Norfolk Place, London W2 1PG
Tel +44 (0)20 75941602 Fax +44 (0)20 75943193
f.calboli
2012 Mar 09
1
rtags for VI(M)
Hi,
according to the help file rtags does not support VI(M) yet. Is there any known hack to ctags to get tags for R in VI(M)?
BW
F
--
Federico C. F. Calboli
Neuroepidemiology and Ageing Research
Imperial College, St. Mary's Campus
Norfolk Place, London W2 1PG
Tel +44 (0)20 75941602 Fax +44 (0)20 75943193
f.calboli [.a.t] imperial.ac.uk
f.calboli [.a.t] gmail.com
2012 Mar 06
2
closing file with close(file) *silently*
Hi All,
I am writing a function that reads a file in
myfile = file('myfile.raw', 'rb')
.
.
.
.
.
close(myfile)
No matter what, I get the warning
Warning message:
closing unused connection 3 (myfile.raw)
Since the whole thing is in a function, I'd like to avoid unecessary noise for the user, and I'd like to kill the warning -- without having to mess with global options.
2011 Nov 25
0
fitting some form of linear model with bimodal distribution of dependent variable
Hi All,
I have a parameter that is bimodal, and I want to get some sort of linear model done with it
results = some.linear.function(bimodal.param ~ factor1 + some other stuff, mydata)
I want to see if factor 1 matters (it has 3 levels, of of which can be taken as baseline), i.e:
summary(results)
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -2.108522
2012 Feb 29
0
MultiPhen 0.3 is available on CRAN
Dear All,
a new version of MultiPhen (0.3) is available on CRAN, and will be available to a mirror near you soon.
*Please upgrade* because this release is a bug fix release. A new version, with improvements in the output and more useful error messages is basically ready, but I will wait to release it until next week to add other possible improvements.
For all asking for the related paper, Paul
2012 Jan 25
1
cat, and printing the last separator
Hi All,
I have the following command:
cat(rbind(table(gen$sex, gen$ddn2)[1,],round(table(gen$sex, gen$ddn2)[1,]/apply(table(gen$sex, gen$ddn2),2,sum) * 100)), sep = c(' (','%)\n'), file = '')
3 (20%)
17 (30%)
15 (31
i.e. it does NOT print the last separator, which is something that bugs me a bit, given that fact I'm trying to have some copy-paste ready stuff to put
2011 Jun 03
1
Surv(): Stop time must be > start time, NA created
I am writing to get a better handle on a warning I am getting from a coxph analysis I am doing.
I am analysing age of onset of dementia *after* the onset of parkinson disease. My data looks like:
age.park age.dem age.death censor x1 x2 x3 x4
1 76 87 88 0 16 33 E3 E3
2 75 84 84 0 33 36 E3 E3
3 77 81 81 1 NA NA
2006 Apr 21
2
forcing apply() to return data frame
Hi All,
I am (almost) successfully using apply() to apply a function recursively
on a data matrix. The function is question is as.genotype() from the
library 'genetics'
apply(subset(chr1, names$breed == 'lab'),2,as.genotype,sep ="")
Unfortuantely apply puts it's results into a matrix object rather than a
data frame, tranforming my factors into numerics and
2009 Aug 04
1
fitted.values less than observed values
Hi All,
I have some data where the dependent variable is a score, low (1:3) or
high (8:9), and the independent variables are 21 genotypic markers.
I'm fitting a logistic regression on the whole dataset after
transforming the score to 0/1 and normal linear regression on the high
and low subsets.
I all cases I have a numer of cases of data 'duplications', i.e.
different
2009 Nov 13
4
R, NIH and FDA
Dear All,
I will soon be working with NIH and possibly FDA. Will I be able to
use R or will I be forced to use SAS?
Cheers,
Federico
--
Federico C. F. Calboli
Department of Epidemiology and Public Health
Imperial College, St. Mary's Campus
Norfolk Place, London W2 1PG
Tel +44 (0)20 75941602 Fax +44 (0)20 75943193
f.calboli [.a.t] imperial.ac.uk
f.calboli [.a.t] gmail.com
2008 Jul 25
1
Plink bed files
Hi All,
does anyone know how to import binary .bed files generated by Plink (http://pngu.mgh.harvard.edu/~purcell/plink/
) into R? the Plink FAQ explains how to conver other types of files,
not the .bed.
Cheers,
Federico
--
Federico C. F. Calboli
Department of Epidemiology and Public Health
Imperial College, St. Mary's Campus
Norfolk Place, London W2 1PG
Tel +44 (0)20 75941602 Fax
2010 Nov 17
1
where are my pspline knots?
Hi All,
I am trying to figure out how to get the position of the knots in a pspline used in a cox model.
my.model = coxph(Surv(agein, ageout, status) ~ pspline(x), mydata) # x being continuous
How do I find out where the knot of the spline are? I would like to know to figure out how many cases are there between each knot.
Best,
Federico
--
Federico C. F. Calboli
Department of Epidemiology
2006 Mar 18
1
listing nodes in paths
Hi All,
I have the following adjacency matrix for a directed graph:
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
[1,] 0 0 0 0 0 0 0 0
[2,] 0 0 0 0 0 0 0 0
[3,] 1 0 0 0 0 0 0 0
[4,] 0 0 1 0 0 0 0 0
[5,] 0 0 1 0 0 0 0 0
[6,] 1 1 0 0 0 0 0 0
[7,] 0 0
2007 Nov 26
4
writing summary() to a text file
Hi All,
I would like to output the results of a function into a text file,
legible as a such. The function produces a summary quite like:
summary(lm(x ~ y + w * z))
[for instance]
and I am not clear how to save this summary into a text file
'automagically', because I need to be able to do it in a for() loop.
Cheers,
Federico
--
Federico C. F. Calboli
Department of Epidemiology
2010 Jun 15
2
coxph and remaing events
Hi everyone,
I'm running a cox ph model on a dataset with a number of variables. Each variable has a different number of missing data, so that coxph() drops the individuals who are missing data at one or more variables. Because of this dropping (totally fine btw) I want to know how many events I am left with in the model. Is there a way of extracting them from the coxph() fit? or in any other
2011 Aug 03
2
strsplit and forward slash '/'
Hi All,
is there a way of using strsplit with a forward slash '/' as the splitting point?
For data such as:
1 T/T C/C 16/33
2 T/T C/C 33/36
3 T/T C/C 16/34
4 T/T C/C 16/31
5 C/C C/C 28/29
6 T/T C/C 16/34
strsplit(my.data[1,1], "/") # and any variation thereof
Error in strsplit(apoe[1, 1], "/") : non-character