Displaying 20 results from an estimated 24 matches for "cov2".
Did you mean:
col2
2012 Oct 13
4
Problems with coxph and survfit in a stratified model with interactions
I?m trying to set up proportional hazard model that is stratified with
respect to covariate 1 and has an interaction between covariate 1 and
another variable, covariate 2. Both variables are categorical. In the
following, I try to illustrate the two problems that I?ve encountered, using
the lung dataset.
The first problem is the warning:
To me, it seems that there are too many dummies
2012 Oct 14
1
Problems with coxph and survfit in a stratified model, with interactions
...ry to fix this in the future (Nabble issue?)
As to the problems: handling strata by covariate interactions turns out to be a bit of a
pain in the posteriorin the survival code. It would have worked, however, if you had done
the following:
fit <- coxph(Surv(time, status) ~ strata(cov1) * cov2, data=...)
or ~ strata(cov1):cov2
or ~ strata(cov1):cov2 + cov2
But by using
~ strata(cov1) + cov1:cov2
you fooled the program into thinking that there was no strata by covariate interaction,
and so it did not follow the special logic necessary for that case.
Second issue: The...
2003 Apr 28
2
stepAIC/lme problem (1.7.0 only)
I can use stepAIC on an lme object in 1.6.2, but
I get the following error if I try to do the same
in 1.7.0:
Error in lme(fixed = resp ~ cov1 + cov2, data = a, random = structure(list( :
unused argument(s) (formula ...)
Does anybody know why?
Here's an example:
library(nlme)
library(MASS)
a <- data.frame( resp=rnorm(250), cov1=rnorm(250),
cov2=rnorm(250), group=rep(letters[1:10],25) )
mod1 <- lme(resp~cov1...
2012 Jul 06
2
Anova Type II and Contrasts
the study design of the data I have to analyse is simple. There is 1 control group (CTRL) and 2 different treatment groups (TREAT_1 and TREAT_2).
The data also includes 2 covariates COV1 and COV2. I have been asked to check if there is a linear or quadratic treatment effect in the data.
I created a dummy data set to explain my situation:
df1 <- data.frame(
Observation = c(rep("CTRL",15), rep("TREAT_1",13), rep("TREAT_2", 12)),
COV1 = c(rep("A1&q...
2009 Aug 02
1
Competing Risks Regression with qualitative predictor with more than 2 categories
...t.seed(10)
> ftime <- rexp(200)
> fstatus <- sample(0:2,200,replace=TRUE)
> gg <- factor(sample(1:3,200,replace=TRUE),1:3,c('a','b','c'))
> cov <- matrix(runif(600),nrow=200)
> dimnames(cov)[[2]] <- c('x1','x2','x3')
> cov2=cbind(cov,gg)
> print(z <- crr(ftime,fstatus,cov2))
convergence: TRUE
coefficients:
x1 x2 x3 gg
0.2624 0.6515 -0.8745 -0.1144
standard errors:
[1] 0.3839 0.3964 0.4559 0.1452
two-sided p-values:
x1 x2 x3 gg
0.490 0.100 0.055 0.430
> summary(z)
Compe...
2008 Aug 18
1
lmer syntax, matrix of (grouped) covariates?
I have a fairly large model:
> length(Y)
[1] 3051
> dim(covariates)
[1] 3051 211
All of these 211 covariates need to be nested hierarchically within a
grouping "class", of which there are 8. I have an accessory vector, "
cov2class" that specifies the mapping between covariates and the 8 classes.
Now, I understand I can break all this information up into individual
vectors (cov1, cov2, ..., cov211, class1, class2, ..., class8), and do
something like this:
model <- lmer(Y ~ 1 + cov1 + cov2 + ... + cov211 +...
2010 Jan 30
2
Questions on Mahalanobis Distance
...d argument supplied to the mahalanobis
funtion).
Any help or guidance would be greatly appreciated.
Thank you! RL
CODE
fit<-lda(pop~v1 + v2 + v3 +...+vn, data=my.data)
x1<-subset(my.data, pop==1)
x2<-subset(my.data, pop==2)
#Save Covariance Matices for each group
cov1<-cov(x1)
cov2<-cov(x2)
#Determine number of rows in each matrix
n1<-nrow(x1); n2<-nrow(x2);
n.rows<-c(n1,n2)
#store mean vectors from lda object
mu1<-fit$means[1,]
mu2<-fit$means[2,]
#Calculate the common Covariance Matrix
S<-(((n.rows[1]-1)*cov1)+((n.rows[2]-1)*cov2)/ (sum(n.rows[1:...
2006 Jul 11
2
Multiple tests on 2 way-ANOVA
...question: How do I proper correct for multiple testing
if I want to estimate in the presence of interaction the two average main effects.
Can some one point me to some literature where I can learn these things?
Here the example, 2x2 factorial with interaction, estimation of average main effects:
cov2 <- matrix(
c(1,-1,-1, 1,
-1, 2, 1,-2,
-1, 1, 2,-2,
1,-2,-2, 4)
, nrow=4, ncol=4, byrow=TRUE)
cm2 <- matrix(c(0, 1, 0, 1/2, 0, 0, 1, 1/2), nrow = 2, ncol=4, byrow=TRUE,
dimnames = list(c("A", "B"), c("C.1", "C.2", "C.3", "C.4"))...
2009 May 22
0
EM algorithm mixture of multivariate
...col.grid="lightblue",angle=120, pch=20)
em2mn<- function(y)
{
n<-length(y[,1])
p<-matrix(0,n,1)
f1<-matrix(0,n,1)
f2<-matrix(0,n,1)
tau<-matrix(0,n,2)
eps<-0.0001
mu01<-c(0,0)
mu02<-c(0,0)
sd01<-matrix(0,2,2)
sd02<-matrix(0,2,2)
cov1<-matrix(0,2,2)
cov2<-matrix(0,2,2)
# 1 inizializzare i valori
alpha0= runif(1,0,1)
for (j in 1:2) {
mu01[j] <- runif(1,min=quantile(y[,j], probs =0.25),
max=quantile(y[,j], probs =0.75))
mu02[j] <- runif(1,min=quantile(y[,j], probs =0.25),
max=quantile(y[,j], probs =0.75))
}
sd01<- var(y[1:round(n/2),])...
2009 May 22
0
EM algorithm mixture of multivariate gaussian
...col.grid="lightblue",angle=120, pch=20)
em2mn<- function(y)
{
n<-length(y[,1])
p<-matrix(0,n,1)
f1<-matrix(0,n,1)
f2<-matrix(0,n,1)
tau<-matrix(0,n,2)
eps<-0.0001
mu01<-c(0,0)
mu02<-c(0,0)
sd01<-matrix(0,2,2)
sd02<-matrix(0,2,2)
cov1<-matrix(0,2,2)
cov2<-matrix(0,2,2)
# 1 inizializzare i valori
alpha0= runif(1,0,1)
for (j in 1:2) {
mu01[j] <- runif(1,min=quantile(y[,j], probs =0.25),
max=quantile(y[,j], probs =0.75))
mu02[j] <- runif(1,min=quantile(y[,j], probs =0.25),
max=quantile(y[,j], probs =0.75))
}
sd01<- var(y[1:round(n/2),])...
2008 Aug 22
1
Help on competing risk package cmprsk with time dependent covariate
...rd errors:
[1] 0.2881 0.3644
two-sided p-values:
[1] 0.018 0.039
...That I dont understand at all since it looks like if "treatment"
covariate had also a significant effect of the first period of time !?
This is absolutely not the case.
So I m surely wrong with a part of this script... cov2 and tf are
pretty obscure for me in the help file of the package. I would really
appreciate advices regarding these 2 "terms".
I was thinking that I might changed : cbind(ifelse(uft <= 1, 1, 0), ifelse(uft > 1, 1, 0) into: cbind(ifelse(uft <= 1, 0, 1),...
2011 Apr 05
0
Changing parameter in local fdr R code
...f0e = f0
p0e = p0
if (nulltype == 0) {
f0e = f00
p0e = p0theo
}
fdre = (p0e * f0e)/(p0e * f0e + f1e)
EE[m] = sum(f1e * fdre)/sum(f1e)
}
EE = EE/EE[1]
names(EE) = mul
}
Cov2.out = loccov2(X, X0, i0, f, fp0["cmest", ], N)
Cov0.out = loccov2(X, matrix(1, length(x), 1), i0, f, fp0["thest",
], N)
if (sw == 3) {
if (nulltype == 0)
Ilfdr = Cov0.out$Ilfdr
else if (nulltype == 1)
Ilfdr = ml.out$Ilfdr...
2002 Dec 04
1
Mixture of Multivariate Gaussian Sample Data
Hey, I am confused about how to generate the sample data from a mixture of
Multivariate Gaussian ditribution.
For example, there are 2 component Gaussian with prior
probability of 0.4 and 0.6,
the means and variances are
u1=[1 1]', Cov1=[1 0;0 1]
and
u2=[-1 -1]', Cov2=[1 0;0 1]
repectively.
So how can I generate a sample of 500 data from the above mixture
distribution?
Thanks.
Fred
2010 Jan 29
2
Vectors with equal sd but different slope
Hi,
what I would need are 2 vector pairs (x,y) and (x1,y1). x and x1 must have
the same sd. y and y1 should also exhibit the same sd's but different ones
as x and x1. Plotting x,y and x1,y1 should produce a plot with 2 vectors
having a different slope. Plotting both vector pairs in one plot with fixed
axes should reveal the different slope.
many thanks
syrvn
--
View this message in
2008 Aug 20
0
cmprsk and a time dependent covariate in the model
...rrors:
[1] 0.2881 0.3644
two-sided p-values:
[1] 0.018 0.039
...That I dont understand at all since it looks like if "treatment" covariate had also a significant effect of the first period of time !?
This is absolutely not the case.
So I m surely wrong with a part of this script... cov2 and tf are pretty obscure for me in the help file of the package. I would really appreciate advices regarding these 2 "terms".
I was thinking that I might changed : cbind(ifelse(uft <= 1, 1, 0), ifelse(uft > 1, 1, 0) ? ? ? ? ? ? ? ? ? into:??????? cbind(ifelse(uft <= 1, 0, 1)...
2004 Oct 31
3
strange results with dmvnorm
...,59638
,23339,40697,47107,8536,57035,55090,44414,1321,12861,21108,32654,27068,38365,22255,31550,11789,45404,53969
,13509,36350)
Dist <- sqrt(outer(x,x, "-")^2 + outer(y,y, "-")^2)
Dist <- Dist/max(Dist)
library(spatial)
Cov1 <- sphercov(Dist, 0.8, alpha=0, se=sqrt(2))
Cov2 <- sphercov(Dist, 0.6, alpha=0, se=sqrt(0.55))
library(geoR)
Cov1b <- cov.spatial(Dist, cov.model= "spherical", cov.pars=c(2, 0.8))
Cov2b <- cov.spatial(Dist, cov.model= "spherical", cov.pars=c(0.55, 0.6))
library(mvtnorm)
dmvnorm(rep(0, nrow(Cov)), sigma=Cov1)
[1] 379...
2007 Oct 09
2
Help with gamm errors
...model proceeds - to a point...
Maximum number of PQL iterations: 20
iteration 1
iteration 2
iteration 3
iteration 4
iteration 5
iteration 6
Error: attempt to select less than one element
Traceback() suggests that the model fits, but that lme can't calculate
something?
2: extract.lme.cov2(ret$lme, mf, n.sr + 1)
1: gamm(present ~ s(week, bs = "cc") + s(week, bs = "cc", by = y1),
random = list(garden = ~1), correlation = corAR1(form = ~1 |
garden), family = binomial, data = count.data2)
Question 2: Any hints on what might be causing this? Am I...
2008 Aug 22
0
Re : Help on competing risk package cmprsk with time dependent covariate
...wo-sided p-values:
> [1] 0.018 0.039
>
> ...That I dont understand at all since it looks like if "treatment"
> covariate had also a significant effect of the first period of time !?
> This is absolutely not the case.
> So I m surely wrong with a part of this script... cov2 and tf are
> pretty obscure for me in the help file of the package. I would really
> appreciate advices regarding these 2 "terms".
>
> I was thinking that I might changed : cbind(ifelse(uft <= 1, 1, 0), ifelse(uft > 1, 1, 0) into: cbind(ifelse(...
2013 Oct 18
1
crr question in library(cmprsk)
Hi all
I do not understand why I am getting the following error message. Can
anybody help me with this? Thanks in advance.
install.packages("cmprsk")
library(cmprsk)
result1 <-crr(ftime, fstatus, cov1, failcode=1, cencode=0 )
one.pout1 = predict(result1,cov1,X=cbind(1,one.z1,one.z2))
predict.crr(result1,cov1,X=cbind(1,one.z1,one.z2))
Error: could not find function
2023 Jan 30
0
Covid Mutations: Cumulative?
...F???????? TRUE? B
897?? B.1 RdRp:P323L RdRp P323L 323?? P L??????? FALSE? B
898?? B.1??? S:D614G??? S D614G 614?? D G??????? FALSE? B
# B.1.1.529 and branches do not have any of the defining mutations of B.1.1;
I have uploaded the code on GitHub:
https://github.com/discoleo/R/blob/master/Stat/Infx/Cov2.Variants.R
1.) Does anyone have a better picture of what is going on?
The sub-variants should have cumulative mutations. This should be the
logic for the sub-lineages and I deduce it also by the data/post on the
GitHub pango page:
https://github.com/cov-lineages/pango-designation/issues/361
2....