Displaying 20 results from an estimated 2000 matches similar to: "Covariance calculation gives different answer than Excel (PR#13720)"
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
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
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"
2006 Sep 02
6
[PATCH] Paravirt framebuffer use xvc as console [4/5]
This is the patch from Amos Waterland for the xenconsole to
use /dev/xvc0 instead of taking over ttys. I''ve fixed a few places
which needed to check for XVC mode in addition to serial mode. Also,
until LANANA responds with an official minor, I''ve adjusted it to use
char 250/187 (in the experimental range) as opposed to 204/187.
(Should be identical to this patch from last
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),
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 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`
2006 Aug 18
4
[PATCH] Paravirtual framebuffer use xvc for xenconsole [4/6]
This is the patch from Amos Waterland for the xenconsole to
use /dev/xvc0 instead of taking over ttys. I''ve fixed a few places
which needed to check for XVC mode in addition to serial mode. Also,
until LANANA responds with an official minor, I''ve adjusted it to use
char 250/187 (in the experimental range) as opposed to 204/187
Signed-off-by: Jeremy Katz
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
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
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 =
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
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
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
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
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
2005 Jun 24
1
interpreting Weibull survival regression
Hi,
I was wondering if someone can help me
interpret the results of running
weibreg.
I run the following and get the
following R output.
> weibreg(Surv(time, censor)~covar)
fit$fail = 0
Call:
weibreg(formula = Surv(time,
censor)~covar)
Covariate Mean Coef
Rel.Risk L-R p Wald p
covar 319.880 -0.002 0.998
0.000
log(scale) 0.000 8.239
2002 Feb 20
3
Pointer to covariates?
In the first line, use the dist function, found in library mva,
to get the distance between each pair of rows. From this
calculate an incidence matrix for which element i,j is true if
row i in dat equals row j in dat (and false elsewhere).
In the second line, for each row calculate the indices of
the matching rows and take the minimum of those as the key.
incid <-
2009 Sep 22
4
Evaluating expresssions as parameter values
I need to play games with an expression similar to the following one:
print(xyplot(DepVar ~ Group|Covar, groups=Othergroup,
data=mydf, pch = 18 ,main="Testcase",auto.key = TRUE))
The problem is that the formula argument (the first argument)
an the groups argument are passed over from another program as strings.
The formula argument does not pose problems,
I can do
2011 Mar 11
2
insertion of a row between individuals
Can someone help with a fairly simple task?
I have a data set where I would like to insert a 0 time event between
individuals:
what I have:
VAR DATE TIME CONC COVAR
1 NOV2 0.25 10 group1
1 NOV2 0.5 20 group1
1 NOV2 1 5 group1
1 NOV2 2 1 group1
1 NOV2 3 0.1 group1
2 NOV2 0.25 10