similar to: ANCOVA in R, single CoVar, two Variables

Displaying 20 results from an estimated 200 matches similar to: "ANCOVA in R, single CoVar, two Variables"

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
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
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:
2011 Jan 31
2
computing var-covar matrix with much missing data
Is there an R function for computing a variance-covariance matrix that guarantees that it will have no negative eigenvalues? In my case, there is a *lot* of missing data, especially for a subset of variables. I think my tactic will be to compute cor(x, use="pairwise.complete.obs") and then pre- and post-multiply by a diagonal matrix of standard deviations that were computed based
2011 Feb 16
2
covar
Hi all, I want to construct relatedness among individuals and have a look at the following script. ######################### rm(list=ls()) N=5 id = c(1:N) dad = c(0,0,0,3,3) mom = c(0,0,2,1,1) sex = c(2,2,1,2,2) # 1= M and 2=F A=diag(nrow = N) for(i in 1:N) { for(j in i:N) { ss = dad[j] dd = mom[j] sx = sex[j] if( ss > 0
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`
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
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 =
2002 Jun 19
1
best selection of covariates (for each individual)
Dear All, This is not strictly R related (though I would implement the solution in R; besides, being this list so helpful for these kinds of stats questions...). I got a "strange" request from a colleage. He has a bunch (approx. 25000) subjects that belong to one of 12 possible classes. In addition, there are 8 covariates (factors) that can take as values either "absence"
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
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),