Displaying 20 results from an estimated 1000 matches similar to: "center option of basehaz in survfit"
2012 Aug 08
1
basehaz() in package 'Survival' and warnings() with coxph
Hello,
I have a couple of questions with regards to fitting a coxph model to a data
set in R:
I have a very large dataset and wanted to get the baseline hazard using the
basehaz() function in the package : 'survival'.
If I use all the covariates then the output from basehaz(fit), where fit is
a model fit using coxph(), gives 507 unique values for the time and the
corresponding cumulative
2008 Apr 07
2
basehaz and newdata
I am unable to get the basehaz function to apply a proportional
hazards model to a new data frame. I replicated my specific situation
with the example for coxph in the help, where I changed the x value of
the first record from 0 to 1. Is there something incorrect in the
syntax that I am using? Thanks in advance!
test1 <- list(time= c(4, 3,1,1,2,2,3),
status=c(1,NA,1,0,1,1,0),
2012 Aug 09
1
basehaz() in package survival and warnings with coxph
I've never seen this, and have no idea how to reproduce it.
For resloution you are going to have to give me a working example of the
failure.
Also, per the posting guide, what is your sessionInfo()?
Terry Therneau
On 08/09/2012 04:11 AM, r-help-request at r-project.org wrote:
> I have a couple of questions with regards to fitting a coxph model to a data
> set in R:
>
> I have a
2007 Jan 19
1
Error in basehaz function ?
Hello R-users.
I believe that the way basehaz (in the survival package) compute the
baseline hazard function is false.
I come to question this function when it gives me hazard probabilities
greater than 1.
Looking at the code I think I've localised the error :
hazard probability is computed as :
H <- -log(surv)
but it seems to me that hazard probabilities is rather an instantaneous
2009 Dec 11
3
Correcting for missing data combinations
I can think of many brute-force ways to do this outside of R, but was
wondering if there was a simple/elegant solution within R instead.
I have a table that looks something like the following:
Factor1 Factor2 Value
A 11/11/2009 5
A 11/12/2009 4
B 11/11/2009 7
B 11/13/2009 8
>From that I need to generate all permutations of Factor1 and Factor2 and
force a 0 for any combination that doesn?t
2002 Nov 29
2
Obtaining the variable names of a glm object
Is names(model1$coef) what you're looking for?
-----Original Message-----
From: Kenneth Cabrera [mailto:krcabrer at epm.net.co]
Sent: 29 November 2002 10:36
Cc: R-help at stat.math.ethz.ch
Subject: [R] Obtaining the variable names of a glm object
Hi, R users!
Suppose I make a model like this:
2003 Mar 06
6
type III Sum Sq in ANOVA table - Howto?
Hello,
as far as I see, R reports type I sums of squares. I'd like to get R to
print out type III sums of squares.
e.g. I have the following model:
vardep~factor1*factor2
to get the type III sum of squares for factor1 I've tried
anova(lm(vardep~factor2+factor1:factor2),lm(vardep~factor1*factor2))
but that didn't yield the desired result.
Could anyone give me a hint how to proceed?
2010 Jan 12
3
How to get minimum value by group
I'd like to get a long data set of minimum values from groups in another data
set.
The following almost does what I want. (Note, I'm using the word factor
differently from it's meaning in R; bad choice of words)
myframe = data.frame(factor1 = rep(1:2,each=8), factor2 =
rep(c("a","b"),each=4, times=2), factor3 = rep(c("x","y"),each=2, times=4),
2004 Jul 29
2
aov for unbalanced design (PR#7144)
Full_Name: Tanya Logvinenko
Version: 1.7.0
OS: Windows 2000
Submission from: (NULL) (132.183.156.125)
For unbalanced design, I ran into problem with ANOVA (aov function). The sum of
squares for only for the second factor and total are computed correctly, but sum
of squares for the first factor is computed incorreclty. Changing order of
factors in the formula changes the ANOVA table. For the
2009 Aug 11
3
loadings function (PR#13886)
Full_Name: Mike Ulrich
Version: 2.9
OS: Mac OSX
Submission from: (NULL) (69.169.178.34)
The help documentation for loadings() lists more then one parameter. The
function call only expects one parameter. The digits, cutoff, and sort
parameters are not used in the function.
## S3 method for class 'loadings':
print(x, digits = 3, cutoff = 0.1, sort = FALSE, ...)
## S3 method for class
2009 Jul 30
3
What is the best method to produce means by categorical factors?
I am attempting to replicate some of my experience from SAS in R and assume
there are best methods for using a combination of summary(), subset, and
which() to produce a subset of mean values by categorical or ordinal
factors.
within sas I would write
proc means mean data=dataset;
class factor1 factor2
var variable1 variable2;
RUN;
producing an output with means for each variable by factor
2009 Dec 08
1
{Lattice} help.
Hi All,
I have a 4-dimensional data. I'm using barchart() function from lattice
package. The R code and data are below - code includes one for stack=TRUE
and other for stack=FALSE.
I would like to present the data in another form which would be plotting
Factor3 levels (P, Q, R, S) as two stacked bars (side by side). Like, for
each level of Factor1 there should be two bars: first bar showing
2002 Nov 29
4
reference
Hello R
How do I refer to you in a publication?
Many Thanks Ross Maller
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
2009 Dec 03
2
(Grouped + Stacked) Barplot
Hi All,
I have googled and tried finding if someone has ever tried producing
(Grouped + Stacked) Barplot. I couldn't find one.
My data needs to be reshaped, but once it is done it would be something like
this:
Factor1 Factor2 Factor3 Value
A X P 10
A X Q 20
A Y P 20
A Y Q 5
A Z P 20
A Z Q 10
B X P 20
B X Q 10
B
2010 Jun 06
1
Why did TukeyHSD not work when I used it for post-hoc for 2way within-subjects anova?
Dear R people,
I have a couple of questions about post-doc analyses for 2 by 2 within
subjects ANOVA. I conducted a psycholinguistic study that combined a 2 by 2
design and a latin square design. Specifically, I had 32 items each of which
generated 4 conditions. Participants saw each of the 32 items only once: 8
in Condition A, 8 in B, 8 in C, and 8 in D. The table below serves as an
example.
2009 Mar 31
3
Factor Analysis Output from R and SAS
Dear Users,
I ran factor analysis using R and SAS. However, I had different outputs from
R and SAS.
Why they provide different outputs? Especially, the factor loadings are
different.
I did real dataset(n=264), however, I had an extremely different from R and
SAS.
Why this things happened? Which software is correct on?
Thanks in advance,
- TY
#R code with example data
# A little
2009 Dec 07
2
column statistics
Hi everybody,
I would like to compute the mean for 1 variable between the rows with
the same levels.
For example, with the dataset below:
Factor1 Factor2 Value
A X 1
A X 2
A Y 3
A Y 4
B X 5
B X 6
B Y
How to plot 2 continous variables on double y-axis with 2 factors: ggplot2, gplot, lattice, sciplot?
2013 Feb 25
3
How to plot 2 continous variables on double y-axis with 2 factors: ggplot2, gplot, lattice, sciplot?
Hi,
I have a data set with two continous variables that I want to plot MEANS (I
am not intrerested in median values) on a double-y graph. I also have 2
factors. I want the factor combinations plotted in different panes.
Dummy dataset:
mydata <- data.frame(factor1 = factor(rep(LETTERS[1:3], each = 40)),
factor2 = factor(rep(c(1:4), each = 10)),
y1 =
2010 Apr 14
1
what is the intercept of a two-way anova model without interaction term?
Dear list,
I have a question regarding the meaning of intercept term in a two-way anova model without interaction term.
for example (let's assume there is no interaction between factor1 and factor2) :
> df
val factor1 factor2
1 48.61533 A t1
2 171.13535 B t1
3 65.96884 C t1
4 63.71222 A t2
5 80.22049 B t2
6
2009 Nov 17
1
lattice barchart
I have a data frame with two factors and want to create panel barcharts with
one factor defining the panels and the other the vertical categories by
which I can count the rows of data in each combination of factors. How do I
do this?
I have been trying to use barchart(~factor1|factor2) but it does not give
the panels as I want them.
The data looks like this:
Factor1 Factor2
A y
B