search for: covars

Displaying 20 results from an estimated 76 matches for "covars".

Did you mean: covar
2008 Feb 20
3
reshaping data frame
Dear all, I'm having a few problems trying to reshape a data frame. I tried with reshape{stats} and melt{reshape} but I was missing something. Any help is very welcome. Please find details below: ################################# # data in its original shape: indiv <- rep(c("A","B"),c(10,10)) level.1 <- rpois(20, lambda=3) covar.1 <- rlnorm(20, 3, 1) level.2
2010 Aug 11
4
Arbitrary number of covariates in a formula
Hello! I have something like this: test1 <- data.frame(intx=c(4,3,1,1,2,2,3), status=c(1,1,1,0,1,1,0), x1=c(0,2,1,1,1,0,0), x2=c(1,1,0,0,2,2,0), sex=c(0,0,0,0,1,1,1)) and I can easily fit a cox model: library(survival) coxph(Surv(intx,status) ~ x1 + x2 + strata(sex),test1) However, I want to
2010 May 24
2
Table to matrix
Dear R users, I am trying to make this (3 by 10) matrix A --A---------------------------------------------------- 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0.5 0.5 0 0 0 0 0 0 0 ------------------------------------------------------- from "mass.func" --mass.func------------------------------------------- > mass.func $`00` prop 5 1 $`10`
2002 Jun 19
1
best selection of covariates (for each individual)
...one covariate with a value of "presence". My colleague wants each subject with more than one "presence" covariate to have one, and only one, covariate be "presence" (of course, the final "present" covariate would belong to the original "present" covars. for that subject): in other words, each subject would be characterized by only one covariate. This "selection of covariates for each subject" (or eliminating covariates for each subject) has to be done in a way that maximizes the correct classification of class based on the presence/...
2006 Feb 20
1
var-covar matrices comparison:
Hi, Using package gclus in R, I have created some graphs that show the trends within subgroups of data and correlations among 9 variables (v1-v9). Being interested for more details on these data I have produced also the var-covar matrices. Question: From a pair of two subsets of data (with 9 variables each, I have two var-covar matrices for each subgroup, that differ for a treatment on one
2008 Dec 28
1
Random coefficients model with a covariate: coxme function
Dear R users: I'm new to R and am trying to fit a mixed model Cox regression model with coxme function. I have one two-level factor (treat) and one covariate (covar) and 32 different groups (centers). I'd like to fit a random coefficients model, with treat and covar as fixed factors and a random intercept, random treat effect and random covar slope per center. I haver a couple of
2006 Feb 22
1
var-covar matrices comparison
> Date: Mon, 20 Feb 2006 16:43:55 -0600 > From: Aldi Kraja <aldi at wustl.edu> > > Hi, > Using package gclus in R, I have created some graphs that show the > trends within subgroups of data and correlations among 9 variables (v1-v9). > Being interested for more details on these data I have produced also the > var-covar matrices. > Question: From a pair of two
2007 Apr 09
3
sem vs. LISREL: sem fails
I am new to R. I just tried to recreate in R (using sem package and the identical input data) a solution for a simple measurment model I have found before in LISREL. LISREL had no problems and converged in just 3 iterations. In sem, I got no solution, just the warning message: "Could not compute QR decomposition of Hessian. Optimization probably did not converge. in: sem.default(ram =
2010 Jan 07
1
faster GLS code
Dear helpers, I wrote a code which estimates a multi-equation model with generalized least squares (GLS). I can use GLS because I know the covariance matrix of the residuals a priori. However, it is a bit slow and I wonder if anybody would be able to point out a way to make it faster (it is part of a bigger code and needs to run several times). Any suggestion would be greatly appreciated. Carlo
2007 Apr 11
1
creating a path diagram in sem
Hello, I finally run my measurement model in sem - successfully. Now, I am trying to print out the path diagram that is based on the results - but for some reason it's not working. Below is my script - but the problem is probably in my very last line: # ANALYSIS OF ANXIETY, DEPRESSION, AND FEAR - LISREL P.31 library(sem) # Creating the ANXIETY, DEPRESSION, AND FEAR intercorrelation matrix
2005 Sep 27
1
Simulate phi-coefficient (correlation between dichotomous vars)
Newsgroup members, I appreciate the help on this topic. David Duffy provided a solution (below) that was quite helpful, and came close to what I needed. It did a great job creating two vectors of dichotomous variables with a known correlation (what I referred to as a phi-coefficient). My situation is a bit more complicated and I'm not sure it is easily solved. The problem is that I must
2013 Mar 11
2
How to 'extend' a data.frame based on given variable combinations ?
Dear expeRts, I have a data.frame with certain covariate combinations ('group' and 'year') and corresponding values: set.seed(1) x <- data.frame(group = c(rep("A", 4), rep("B", 3)), year = c(2001, 2003, 2004, 2005, 2003, 2004, 2005), value = rexp(7)) My goal is essentially to
2011 Aug 30
2
Error in evalauating a function
Hi, ? I am very new to R. So, pardon my dumb question. I was trying to write my own function to run a different model (perform an ordered logistic regression) using the example in website http://pngu.mgh.harvard.edu/~purcell/plink/rfunc.shtml But R returns a error `R Error in eval(expr, envir, enclos) : object 's' not found' when I run it. What am I doing wrong here? Here's
2010 May 11
2
ANCOVA in R, single CoVar, two Variables
Hello, I am VERY new to R, just picking it up infact. I have got my head around the basics of ANOVA with post hoc tests but I am struggling with regression, especially with ANCOVAs. I have two sets of data, one of type A, one of type B. Both have been placed in a wind tunnel and sampled every week. The co variate is of course the days since the start. An example is day A B 0 10.0 10.0 7 9.0
2011 Nov 23
0
Error using coeftest() with a heteroskedasticity-consistent estimation of the covar.
Hey I am trying to run /coeftest()/ using a heteroskedasticity-consistent estimation of the covariance matrix and i get this error: # packages >library(lmtest) >library(sandwich) #test > coeftest(*GSm_inc.pool*, vcov = vcovHC(*GSm_inc.pool*, method="arellano", > type="HC3")) /Fehler in 1 - diaghat : nicht-numerisches Argument f?r bin?ren Operator/ something like:
2012 Mar 23
0
loops
Hi I'm running QDA on some data and calculating the discriminant function. qda.res <- qda(type ~ npreg + glu + bp + skin + bmi + ped + age) ind_yes <- c(1:N)[type == "Yes"] > ind_no <- c(1:N)[type == "No"] > cov_yes <- cov(table[ind_yes, 1:7] ) > cov_no <- cov(table[ind_no, 1:7] ) > covar<-list(cov_no, cov_yes) qdf<- function(x,
2009 May 04
3
GEV para datos no estacionarios
Hola a todos, Soy nuevo en R y estoy intentando modelizar una serie de datos no estacionarios usand la distribucion Generalizada de Valores Extremos GEV. ¿Podriais indicarme como se modeliza una tendencia polinómica (cuadrática, por ejemplo) en alguno de los 3 parámetros (situación, escala o forma)? He encontrado documentación a cerca de modelización linear o exponencial, pero no acabo de
2012 Jul 26
2
coxph weirdness
Hi all, I cant' wrap my head around an error from the coxph function (package survival). Here's an example: library(survival) n = 100; set.seed(1); time = rexp(n); event = sample(c(0,1), n, replace = TRUE) covar = data.frame(z = rnorm(n)); model = coxph(Surv(time, event)~ . , data = covar) R gives the following error: > model = coxph(Surv(time, event)~ . , data = covar) Error in
2012 Oct 04
1
geoRglm with factor variable as covariable
Dear R users. I'm trying to fit a generalised linear spatial mode using the geoRglm package. To do so, I'm preparing my data (geodata) as follow: geoData9093 = as.geodata(data9093, coords.col= 17:18, data.col=15,* covar.col=16*) where covar.col is a factor variable (years in this case 90-91-92-93)). Then I run the model as follow: / model.5 = list(cov.pars=c(1,1),
2010 Jun 02
2
glmnet strange error message
Hello fellow R users, I have been getting a strange error message when using the cv.glmnet function in the glmnet package. I am attempting to fit a multinomial regression using the lasso. covars is a matrix with 80 rows and roughly 4000 columns, all the covariates are binary. resp is an eight level factor. I can fit the model with no errors but when I try to cross-validate after about 30 seconds I get the following: > glmnet.fit = glmnet(covars,resp,family="multinomial") &gt...