similar to: Problems with coxph and survfit in a stratified model, with interactions

Displaying 20 results from an estimated 1000 matches similar to: "Problems with coxph and survfit in a stratified model, with interactions"

2012 Oct 13
4
Problems with coxph and survfit in a stratified model with interactions
I?m trying to set up proportional hazard model that is stratified with respect to covariate 1 and has an interaction between covariate 1 and another variable, covariate 2. Both variables are categorical. In the following, I try to illustrate the two problems that I?ve encountered, using the lung dataset. The first problem is the warning: To me, it seems that there are too many dummies
2003 Apr 28
2
stepAIC/lme problem (1.7.0 only)
I can use stepAIC on an lme object in 1.6.2, but I get the following error if I try to do the same in 1.7.0: Error in lme(fixed = resp ~ cov1 + cov2, data = a, random = structure(list( : unused argument(s) (formula ...) Does anybody know why? Here's an example: library(nlme) library(MASS) a <- data.frame( resp=rnorm(250), cov1=rnorm(250), cov2=rnorm(250),
2012 Jul 06
2
Anova Type II and Contrasts
the study design of the data I have to analyse is simple. There is 1 control group (CTRL) and 2 different treatment groups (TREAT_1 and TREAT_2). The data also includes 2 covariates COV1 and COV2. I have been asked to check if there is a linear or quadratic treatment effect in the data. I created a dummy data set to explain my situation: df1 <- data.frame( Observation =
2008 Aug 18
1
lmer syntax, matrix of (grouped) covariates?
I have a fairly large model: > length(Y) [1] 3051 > dim(covariates) [1] 3051 211 All of these 211 covariates need to be nested hierarchically within a grouping "class", of which there are 8. I have an accessory vector, " cov2class" that specifies the mapping between covariates and the 8 classes. Now, I understand I can break all this information up into individual
2010 Jan 30
2
Questions on Mahalanobis Distance
Hello, I am a new R user and trying to learn how to implement the mahalanobis function to measure the distance between to 2 population centroids. I have used STATISTICA to calculate these differences, but was hoping to learn to do the analysis in R. I have implemented the code as below, but my results are very different from that of STATISTICA, and I believe I may not have interpreted the help
2006 Jul 11
2
Multiple tests on 2 way-ANOVA
Dear r-helpers, I have a question about multiple testing. Here an example that puzzles me: All matrixes and contrast vectors are presented in treatment contrasts. 1. example: library(multcomp) n<-60; sigma<-20 # n = sample size per group # sigma standard deviation of the residuals cov1 <- matrix(c(3/4,-1/2,-1/2,-1/2,1,0,-1/2,0,1), nrow = 3, ncol=3, byrow=TRUE, dimnames =
2009 Aug 02
1
Competing Risks Regression with qualitative predictor with more than 2 categories
Hello, I have a question regarding competing risk regression using cmprsk package (function crr()). I am using R2.9.1. How can I do to assess the effect of qualitative predictor (gg) with more than two categories (a,b,c) categorie c is the reference category. See above results, gg is considered like a ordered predictor ! Thank you for your help Jan > # simulated data to test > set.seed(10)
2013 Oct 18
1
crr question‏ in library(cmprsk)
Hi all I do not understand why I am getting the following error message. Can anybody help me with this? Thanks in advance. install.packages("cmprsk") library(cmprsk) result1 <-crr(ftime, fstatus, cov1, failcode=1, cencode=0 ) one.pout1 = predict(result1,cov1,X=cbind(1,one.z1,one.z2)) predict.crr(result1,cov1,X=cbind(1,one.z1,one.z2)) Error: could not find function
2002 Dec 04
1
Mixture of Multivariate Gaussian Sample Data
Hey, I am confused about how to generate the sample data from a mixture of Multivariate Gaussian ditribution. For example, there are 2 component Gaussian with prior probability of 0.4 and 0.6, the means and variances are u1=[1 1]', Cov1=[1 0;0 1] and u2=[-1 -1]', Cov2=[1 0;0 1] repectively. So how can I generate a sample of 500 data from the above mixture distribution? Thanks. Fred
2009 May 22
0
EM algorithm mixture of multivariate
Hi, i would to know, if someone have ever write the code to estimate the parameter (mixing proportion, mean, a var/cov matrix) of a mixture of two multivariate normal distribution. I wrote it and it works (it could find mean and mixing proportion, if I fix the var/cov matrix), while if I fix anything, it doesn't work. My suspect is that when the algorithm iterates the var/cov matrix, something
2009 May 22
0
EM algorithm mixture of multivariate gaussian
Hi, i would to know, if someone have ever write the code to estimate the parameter (mixing proportion, mean, a var/cov matrix) of a mixture of two multivariate normal distribution. I wrote it and it works (it could find mean and mixing proportion, if I fix the var/cov matrix), while if I fix anything, it doesn't work. My suspect is that when the algorithm iterates the var/cov matrix, something
2010 Jan 29
2
Vectors with equal sd but different slope
Hi, what I would need are 2 vector pairs (x,y) and (x1,y1). x and x1 must have the same sd. y and y1 should also exhibit the same sd's but different ones as x and x1. Plotting x,y and x1,y1 should produce a plot with 2 vectors having a different slope. Plotting both vector pairs in one plot with fixed axes should reveal the different slope. many thanks syrvn -- View this message in
2004 Oct 31
3
strange results with dmvnorm
I am experiencing strange results using dmvnorm. I define a scaled distance matrix from the coordinates bellow and then calculate a covariance matrix using a spherical correlation function. Then with certain combinations of range and sill parameters dmvnorm is returning values greater than 1. Surely the results of dmvnorm should be in the interval 0:1 (or do I just nead a holiday?). In addition
2005 Oct 05
1
Analyses of covariation with lme() or lm()
Hello all! I have a problem that calls for a better understanding, than mine, of how lme() uses the random part of the call. The dataset consists of eleven field trials (Trial) with three replicates (Block) and four fertiliser treatments (Treat). Analysing for example yield with lme() is easy: m1 <- lme(Yield ~ Treat, data=data, random =~1| Trial/Block) giving estimates of
2003 Jun 04
3
Slow ttests in R-devel
Hello ... I've noticed that some of our Bioconductor code was running drastically slower under current R-devel vs. current R-patched - one example is below using a ttest. I have the following snippet of code that demonstrates the problem while avoiding "real" code that takes an extremely long time to finish on R-devel: library(genefilter) data(eset) eset$cov1 z <-
2020 May 04
2
[EXTERNAL] How to get branch coverage by using 'source-based code coverage'
Hi, Alan Thanks for making it clear. But I was more confused now :( I tested on a simple program and used both gcov and lcov to get branch coverage. The code and build commands as below: *Example simple.cc* #include <string> // If not comment this line, the branch coverage won't reach to 100% // #include <iostream> int main(int argc, const char* argv[]) { std::string str =
2012 Apr 08
1
Avoid loop with the integrate function
Dear R users, I am running a loop with the integrate function. I have pasted the code below. I am integrating a function from time=0 to the time value in every row. I have to perform this integration over thousands of rows with different parameters in each row. Could someone please suggest if there is an efficient/faster/easier way to do this by avoiding the loops ? Thank you so much for your
2005 Feb 23
1
How to conctruct an inner grouping for nlme random statement?
Hello. Im hoping someone can help with a grouping question related to the "random=" statement within the nlme function. How do you specify that some grouping levels are inner to others? I tried several things, given below. Lets say I have a data frame with five variables, resp, cov1, ran1, ran2, group1, and group 2. The formula is resp~cov1 + ran1 + ran2, where the ran are random
2009 Sep 08
1
Obtaining value of median survival for survfit function to use in calculation
Hi, I'm sure this should be simple but I can't figure it out! I want to get the median survival calculated by the survfit function and use the value rather than just be able to print it. Something like this: library(survival) data(lung) lung.byPS = survfit(Surv (time, status) ~ ph.ecog, data=lung) # lung.byPS Call: survfit(formula = Surv(time, status) ~ ph.ecog, data = lung) 1
2006 Mar 11
2
Draw level lines on the surface of a bivariate function
Hello, Is it possible to draw level lines on the surface of a bivariate function? In the following example, to draw surface and levels lines for a multivariate normal law, I use persp, trans3d, contourLines and lines, but if the lines are correctly drawn, some parts of them are, of course, visible even if they are drawn on a non visible "face". Any suggestion to avoid this problem