search for: outcome

Displaying 20 results from an estimated 2448 matches for "outcome".

2012 Aug 17
3
Error: level sets of factors are different?
Why the error is coming? even though the length of outcome.new$compkey and outcome.new$armkey were exactly same. Can anyone help? setwd("D:/AZ") library("RODBC") cdb_cnct <- odbcConnectExcel("AZIF_DC_GVK_NSCLC_MSALL_287papers_02072012_141450_v1_4.xls") outcomes <- sqlFetch(cdb_cnct, "Outcomes_info") odbcClose(...
2009 Mar 04
2
Selecting one row or multiple rows per ID
Hi, Could someone help with coding this in R? I need to select one row per patient i in clinic j. The data is organized similar to that shown below. Two columns - patient i in column j identify each unique patient. There are two columns on outcome. Some patients have multiple rows with each row representing one visit, coded for in the column, visit. Some patients have just one row indicating data from a single visit. I need to select one row per patient i in clinic j using the following algorithm: If patient has outcome recorded at visit 2...
2008 Feb 03
1
Effect size of comparison of two levels of a factor in multiple linear regression
Dear R users, I have a linear model of the kind outcome ~ treatment + covariate where 'treatment' is a factor with three levels ("0", "1", and "2"), and the covariate is continuous. Treatments "1" and "2" both have regression coefficients significantly different from 0 when using treatment contr...
2009 Jan 30
1
simulating outcomes - categorical distribution (?)
Hi, I am simulating an event that has 15 possible outcomes and I have a vector 'pout' that gives me the probability of each outcome - different outcomes have different probabilities. Does anyone know a simple way of simulating the outcome of my event? If my event had only two possible outcomes (0/1) I would pick a uniform random number between 0...
2010 Jun 02
1
how to label the som notes by the majority vote
...o have only one label for each note either by majority vote or prediction. Can anyone give some suggestions or advice? Thanks so much! alex<-read.table("/home/cdu/operon/alex2.txt", , sep="\t", skip=0, header=T, fill=T) alex1<-alex[,c(1:257)] levels(alex1$Label) alex1$outcome<-as.numeric(alex1$Label) alex1$outcome[1:20] #self-organizing maps(unsupervised learning) library("kohonen") #SOM, the supervised learning, train the map using outcome as the class variable. set.seed(13) final.xyf<- xyf(data=as.matrix(alex1[,c(1:256)]), Y=classvec2classmat(alex1...
2012 Jun 27
1
Replacing sets of rows in matrix within a loop
Dear R-help, I am writing some simulation code to create multiple sets of time-to-event clinical trial data (for use in meta-analysis). Within each trial, I want to apply censoring via simulation of uniform variables (with minimum zero and maximum the median outcome time for that particular trial). I have started by pre-allocating a matrix which has 3 columns; one for trial number, one for patient number, and I want to complete the third with the results of the uniform simulation. For example, I have : n<-10 ## patients per trial trials<-3 ## 3 trials...
2010 Nov 17
1
efficient conversion of matrix column rows to list elements
Hi List, I'm hoping to get opinions for enhancing the efficiency of the following code designed to take a vector of probabilities (outcomes) and calculate a union of the probability space. As part of the union calculation, combn() must be used, which returns a matrix, and the parallelized version of lapply() provided in the multicore package requires a list. I've found that parallelization is very necessary for vectors of outcomes...
2010 Jun 03
1
problem with 'svyby' function from SURVEY package
Hello, I'm using a complex survey dataset and my goal is to simply spit out a bunch of probability-weighted outcome variable means for the different levels of covariate. So I first define the structure of the study design (I'm using the CDC's NHANES data): dhanes <- svydesign(id=~PSU, strat=~STRATA, weight=~lab_weight, data=final, nest=TRUE) No problem there. Now I use the "svyby" function...
2009 Nov 07
1
lme4 and incomplete block design
Dear list members, I try to simulate an incomplete block design in which every participants receives 3 out of 4 possible treatment. The outcome in binary. Assigning a binary outcome to the BIB or PBIB dataset of the package SASmixed gives the appropriate output. With the code below, fixed treatment estimates are not given for each of the 4 possible treatments, instead a kind of summary measure(?) for 'treatment' is given. bloc...
2015 May 28
2
La ejecución de mi script R es muy lenta
...si R es lento en esta > operación o es que mi código no está optimizado y no estoy haciéndolo de la > forma correcta. > El código de mi programa es el siguiente: > > > #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > ## Set-A.csv y Outcomes.csv deben estar en el directorio actual > # Transforma csv a data frame > seta <- read.csv('Set-A.csv'); > outcomes <- read.csv('Outcomes-A.csv'); > > ids <- as.character(unique(outcomes$RecordID)); > ## Número de RecordsID distintos > Length_ids <...
2015 May 29
3
Mi script R es muy lento
Hola, quiero compartir con vosotros mi problema y la solución que me han planteado. Mi programa carga Outcomes.csv y Set-A.csv (descargados de http://garrickadenbuie.com/blog/2013/04/11/visualize-physionet-data-with-r/, apartado Getting Started --> the code and the data set) de unos 50MB entre los dos. Mi código era: # Transforma csv a data frame seta <- read.csv('Set-A.csv'); outcomes &l...
2009 Sep 04
3
Using anova(f1, f2) to compare lmer models yields seemingly erroneous Chisq = 0, p = 1
...to compare the fit of various models. When I run two models, the output of each model is generated correctly as far as I can tell (e.g. summary(f1) and summary(f2) for the multilevel model output look perfectly reasonable), and in this case (see below) predictor.1 explains vastly more variance in outcome than predictor.2 (R2 = 15% vs. 5% in OLS regression, with very large N). What I am utterly puzzled by is that when I run an anova comparing the two multilevel model fits, the Chisq comes back as 0, with p = 1. I am pretty sure that fit #1 (f1) is a much better predictor of the outcome than f2, wh...
2015 May 28
2
La ejecución de mi script R es muy lenta
Hola, Si no tienes inconveniente en compartir tu conjunto de datos (puedes dejarlo en un Dropbox y compartir enlace) o incluir una salida de la variables: "seta" y "outcomes" (función "save.image()") con eso podemos darte alguna solución mucho más rápida que la que planteas. En tu código con un bucle estás tratando de rellenar una lista que son los diferentes agregados y esto se puede hacer mucho más rápido (segundos) con varios paquetes: data.table, d...
2010 Oct 31
1
Questions about Probit Analysis
...://bit.ly/bU9xL5 and I mainly have two questions. (1) The first is almost about data manipulation. Consider the following snippet ################################################## mydata <- read.csv(url("http://www.ats.ucla.edu/stat/r/dae/binary.csv")) names(mydata) <- c("outcome","x1","x2","x3") myprobit <- glm(mydata$outcome~mydata$x1+mydata$x2+as.factor(mydata$x3), family=binomial(link="probit")) print(summary(myprobit)) #Now assume I can make a regression only on x1 myprobit2 <- glm(mydata$outcome~mydata$x1, fami...
2011 Feb 08
1
Error in example Glm rms package
Hi all! I've got this error while running example(Glm) library("rms") > example(Glm) Glm> ## Dobson (1990) Page 93: Randomized Controlled Trial : Glm> counts <- c(18,17,15,20,10,20,25,13,12) Glm> outcome <- gl(3,1,9) Glm> treatment <- gl(3,3) Glm> f <- glm(counts ~ outcome + treatment, family=poisson()) Glm> f Call: glm(formula = counts ~ outcome + treatment, family = poisson()) Coefficients: (Intercept) outcome2 outcome3 treatment2 treatment3 3.045e+00 -4....
2010 Jun 22
1
Generalised Estimating Equations on approx normal outcome with limited range
...imately normally distributed (with ~50 levels). One aim of the analysis is to assess whether the measures are related to certain covariates, and I have tried the generalised estimating equation function geeglm (library geepack) with the 'gaussian' family details like so: geeout <- geeglm(outcome ~ covariate1 + covariate2, id=familyID, family=gaussian, data=dat, corstr="unstructured") But I'm thinking that the limited range of the outcome violates the assumption of normality and that the results could be off. Q: Is there a way in R, either in geeglm or another appropriate fun...
2010 Dec 14
1
rpart - how to estimate the “meaningful” predictors for an outcome (in classification trees)
Hi dear R-help memebers, When building a CART model (specifically classification tree) using rpart, it is sometimes obvious that there are variables (X's) that are meaningful for predicting some of the outcome (y) variables - while other predictors are relevant for other outcome variables (y's only). *How can it be estimated, which explanatory variable is "used" for which of the predicted value in the outcome variable?* Here is an example code in which x2 is the only important variable fo...
2008 Mar 05
1
CROSSOVER TRIALS IN R (Binary Outcomes)
I will like to analyse a binary cross over design using the random effects model. The probability of success is assumed to be logistic. Suppose as an example, we have 4 subjects undergoing a crossover design, where the outcome is either success or failure. The first two subjects receive treatment "A" first followed by treatment "B". The remaining two subjects receive treatments in the reverse order. The outcomes for the subjects is the sequence "AB" are as follows: (0,1) and (0,0). While...
2006 Jun 18
1
how to successfully remove missing values for a repeated measures analysis
...s undertaken are outlined below (#). Any assistance is appreciated in relation to how to remove the missing values so the analysis is run. Feedback regarding the prior steps is also welcomed . Bob Green #Step 1 study1dat <- read.csv("c:\\study1.csv",header=T) attach (study1dat) outcome <- c(t1frq, t2frq,t3frq,t4frq) grp <- factor( rep(group, 2,length=368) ) time <- gl(4,92,length=368) subject <- gl(92,1,length=368) data.frame(subject, grp, time, outcome) # there are 3 missing values in $outcome #Step 2 - create a new data frame removing missing values from variable...
2006 Nov 10
3
Confidence interval for relative risk
...a confidence interval is presented for the risk ratio and I do not find it credible. I show below my attempts to do this in R. The example is slightly changed from the authors'. I can obtain a confidence interval for the odds ratio from fisher.test of course === fisher.test example === > outcome <- matrix(c(500, 0, 500, 8), ncol = 2, byrow = TRUE) > fisher.test(outcome) Fisher's Exact Test for Count Data data: outcome p-value = 0.00761 alternative hypothesis: true odds ratio is not equal to 1 95 percent confidence interval: 1.694792 Inf sample estimates: odds...