similar to: adding a column to a matrix

Displaying 20 results from an estimated 500 matches similar to: "adding a column to a matrix"

2007 May 07
4
creating a new column
hie l would like to create a 6th column "actual surv time" from the following data the condition being if censoringTime>survivaltime then actual survtime =survival time else actual survtime =censoring time the code l used to create the data is s=2 while(s!=0){ n=20 m<-matrix(nrow=n,ncol=4)
2012 May 11
2
survival analysis simulation question
Hi, I am trying to simulate a regression on survival data under a few conditions: 1. Under different error distributions 2. Have the error term be dependent on the covariates But I'm not sure how to specify either conditions. I am using the Design package to perform the survival analysis using the survreg, bj, coxph functions. Any help is greatly appreciated. This is what I have so far:
2010 Nov 24
2
Is there an equivalent to predict(..., type="linear") of a Proportional hazard model for a Cox model instead?
Hi all, Is there an equivalent to predict(...,type="linear") of a Proportional hazard model for a Cox model instead? For example, the Figure 13.12 in MASS (p384) is produced by: (aids.ps <- survreg(Surv(survtime + 0.9, status) ~ state + T.categ + pspline(age, df=6), data = Aidsp)) zz <- predict(aids.ps, data.frame(state = factor(rep("NSW", 83), levels =
2007 Oct 29
3
using survfit
hie when i use plot.survfit to plot more than one graph why I only see the last graph how do i see the other graphs.for example n=20 n1=n/2 n2=n/4 a11=4;a12=4 ;a21=4 ;a22=4 t1<-array(1,c(n1)) t2<-array(2,c(n1)) treatgrp=matrix(c(t1,t2))
2020 Sep 29
5
2 KM curves on the same plot
Hello, Can anyone suggest a simple way to generate a Kaplan-Meier plot with 2 survfit objects, just like this one:? https://drive.google.com/file/d/1fEcpdIdE2xYtA6LBQN9ck3JkL6-goabX/view?usp=sharing Suppose I have 2 survfit objects: fit1 is for the curve on the left (survtime has been truncated to the cutoff line: year 5), fit2 is for the curve on the right (minimum survival time is at the
2007 May 07
2
computing logrank statistic/test
hie how do you compute the logrank test using R what commands do you use my data looks something like just an example treatmentgrp strata censoringTime survivalTime censoring act.surv.time [1,] 2 2 42.89005 1847.3358 1 42.89005 [2,] 1 1 74.40379 440.3467 1 74.40379 [3,] 2 2
2007 Oct 19
6
r achives
sorry but how do i accsess r archives __________________________________________________ [[alternative HTML version deleted]]
2007 Feb 21
2
Coxph and ordered factors
Dear useRs, I am trying to fit a Cox PH model on survival data from a lung cancer dataset. I would like to include the patient staging (I-IV) as a covariate. For this I use the following function: coxph(Surv(time,status) ~ stage) The staging information is a categorical variable, and it is important to take the ordering into account (I<II<III<IV). Does the coxph function handle
2003 Mar 12
1
simulating 'non-standard' survival data
Dear all, I'm looking for someone that help me to write an R function to simulate survival data under complex situations, namely time-varying hazard ratio, marginal distribution of survival times and covariates. The algorithm is described in the reference below and it should be not very difficult to implement it. However I tried but without success....;-( Below there the code that I used; it
2007 Oct 18
1
programming question
hie i'm tryimg to generate two survival data using the following code (I know its ugly ) but it seems to repeat two of the variables can any one tell me whats the porblem. n=20 n1=n/2 n2=n/4 a11=1 ;a12=1.4 ;a21=16 ;a22=a12 * a21 t1<-array(1,c(n1)) t2<-array(2,c(n1)) treatgrp=matrix(c(t1,t2))
2007 May 01
7
logrank test
how do l programme the logrank test. l am trying to compare 2 survival curves --------------------------------- [[alternative HTML version deleted]]
2007 Nov 13
3
cronbach's alpha
hie 1...i'm trying to carryout a relibility testusing cronbach's alpha what fuctin do i use. 2.. this is more of a statistical question.if the alpha value for all the variables is negative what does it mean. and if the alpha value is negative for all tyha variables but is greater than 0.7 for some sections of the variables what does that mean thanks in advance
2007 Apr 25
0
Use of Lexis function to convert survival data to counting format
I'm trying to convert a dataset from the time-independent analysis form > head(addicts) id clinic status survtime prison meth clinic01 1 1 1 1 428 0 50 1 2 2 1 1 275 1 55 1 3 3 1 1 262 0 55 1 into the "counting data format" necessary to perform extended Cox regression. I got
2007 Apr 19
1
Random number generator in R compared
I am trying to generate survival data using R .Im trying to randomly generate a column of 1s and 0 and another column randomly generated using an exponential distribution but l cant seem to get the random function. how do l go about it thanks in advance rt chiruka --------------------------------- [[alternative HTML version deleted]]
2007 May 08
1
censoring
in R when carring out the log rank test is the censored variable denoted by 1 or 0 or its of no consequence. thanks --------------------------------- always stay connected to friends. [[alternative HTML version deleted]]
2007 Apr 25
2
creating random numbers
l want to create a column of 1 and 2 randomly what command should l use eg treatment strata 1 1 2 0 1 1 2 1 2 0 2 1 2 0 1 0 these should be created randomly secondly if l have
2007 May 02
2
missing package
l'm trying to find the "survdiff" package/function but it seems i cant get it how do l instal it if its not there thanks --------------------------------- [[alternative HTML version deleted]]
2007 May 16
2
creating different strata
hie l would like to create about ten strata l have tried using sample(c(1,2),1,replace=TRUE) but all l get is a vector of 1 and 2 if i change it to sample(c(1,10),1,replace=TRUE) it gives me a vector of 1 and 10 how do l go about it --------------------------------- [[alternative HTML version deleted]]
2007 Nov 12
2
specifying decimal places
hie how do I specify the number of decuimal places for my calulations thanks __________________________________________________ [[alternative HTML version deleted]]
2010 Dec 05
0
Help with time varying covariate-unfold function
Hello All, I am trying to use the unfold function in RcmdrPlugin.survival library, which converts the survival data with time varying covariates to the counting process notation. The problem is somehow, the event indicator created is not correct. Below is the data, I am trying to convert: CASE TRT FAILTIME FAILCENS SEX AGE IGG0 IGG28 IGG42 IGG84 IGG364 26003 A 11.2033