Displaying 20 results from an estimated 200 matches similar to: "Anova Type II and Contrasts"
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
First, here is your message as it appears on R-help.
On 10/14/2012 05:00 AM, r-help-request@r-project.org wrote:
> 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
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),
2024 Oct 04
3
apply
Homework questions are not answered on this list.
Best,
Uwe Ligges
On 04.10.2024 10:32, Steven Yen wrote:
> The following line calculates standard deviations of a column vector:
>
> se<-apply(dd,1,sd)
>
> How can I calculate the covariance matrix using apply? Thanks.
>
> ______________________________________________
> R-help at r-project.org mailing list -- To
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
2010 Jan 30
2
Questions on Mahalanobis Distance
Hello,
I am a new R user and trying to learn how to implement the mahalanobis
function to measure the distance between to 2 population centroids. I
have used STATISTICA to calculate these differences, but was hoping to learn
to do the analysis in R. I have implemented the code as below, but my
results are very different from that of STATISTICA, and I believe I may not
have interpreted the help
2006 Jul 11
2
Multiple tests on 2 way-ANOVA
Dear r-helpers,
I have a question about multiple testing.
Here an example that puzzles me:
All matrixes and contrast vectors are presented in treatment contrasts.
1. example:
library(multcomp)
n<-60; sigma<-20
# n = sample size per group
# sigma standard deviation of the residuals
cov1 <- matrix(c(3/4,-1/2,-1/2,-1/2,1,0,-1/2,0,1), nrow = 3, ncol=3, byrow=TRUE,
dimnames =
2024 Oct 04
1
apply
On 10/4/2024 5:13 PM, Steven Yen wrote:
> Pardon me!!!
>
> What makes you think this is a homework question? You are not
> obligated to respond if the question is not intelligent enough for you.
>
> I did the following: two ways to calculate a covariance matrix but
> wonder how I might replicate the results with "apply". I am not too
> comfortable with the
2024 Oct 04
1
apply
Pardon me!!!
What makes you think this is a homework question? You are not obligated
to respond if the question is not intelligent enough for you.
I did the following: two ways to calculate a covariance matrix but
wonder how I might replicate the results with "apply". I am not too
comfortable with the online do of apply.
> set.seed(122345671) > n<-3 > x<-rnorm(n); x
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
2024 Oct 04
1
apply
Even if this is not a homework question, it smells like one. If you read the Posting Guide it warns you that homework is off-topic, so when you impose an arbitrary constraint like "must use specific unrelated function" we feel like you are either cheating or wasting our time, and it is up to you to explain why we should follow you down this rabbit hole, keeping in mind that statistics
2024 Oct 04
3
apply
OK. Thanks to all. Suppose I have two vectors, x and y. Is there a way
to do the covariance matrix with ?apply?. The matrix I need really
contains the deviation products divided by the degrees of freedom (n-1).
That is, the elements
(1,1), (1,2),...,(1,n)
(2,1), (2,2),...., (2,n)
....
(n,1),(n,2),...,(n,n).
> Hello,
>
> This doesn't make sense, if you have only one vector you
2024 Oct 04
1
apply
Hello,
If you have a numeric matrix or data.frame, try something like
cov(mtcars)
Hope this helps,
Rui Barradas
?s 10:15 de 04/10/2024, Steven Yen escreveu:
> On 10/4/2024 5:13 PM, Steven Yen wrote:
>
>> Pardon me!!!
>>
>> What makes you think this is a homework question? You are not
>> obligated to respond if the question is not intelligent enough for you.
2009 Aug 02
1
Competing Risks Regression with qualitative predictor with more than 2 categories
Hello,
I have a question regarding competing risk regression using cmprsk package (function crr()). I am using R2.9.1. How can I do to assess the effect of qualitative predictor (gg) with more than two categories (a,b,c) categorie c is the reference category. See above results, gg is considered like a ordered predictor !
Thank you for your help
Jan
> # simulated data to test
> set.seed(10)
2024 Oct 04
2
apply
Hello
I have a vector:
set.seed(123) > n<-3 > x<-rnorm(n); x [1] -0.56047565 -0.23017749
1.55870831 I like to create a matrix with elements containing variances
and covariances of x. That is var(x[1]) cov(x[1],x[2]) cov(x[1],x[3])
cov(x[2],x[1]) var(x[2]) cov(x[2],x[3]) cov(x[3],x[1]) cov(x[3],x[2])
var(x[3]) And I like to do it with "apply". Thanks.
On 10/4/2024 6:35
2024 Oct 04
1
apply
Hello,
This doesn't make sense, if you have only one vector you can estimate
its variance with
var(x)
but there is no covariance, the joint variance of two rv's. "co" or
joint with what if you have only x?
Note that the variance of x[1] or any other vector element is zero, it's
only one value therefore it does not vary. A similar reasonong can be
applied to cov(x[1],
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
2024 Oct 04
1
apply
It's still hard to figure out what you want. If you have two vectors
you can compute their (2x2) covariance matrix using cov(cbind(x,y)).
If you want to compute all pairwise squared differences between elements
of x and y you could use outer(x, y, "-")^2.
Can you explain a little bit more about (1) the context for your
question and (2) why you want/need to use apply() ?
On
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
2020 May 03
2
[EXTERNAL] How to get branch coverage by using 'source-based code coverage'
Hi, Alan
Really very excited to receive your email and sorry to be slow replying, it
has been exceptionally busy over the last few days ;(
Your explanation made the problem clear to me. So gcov branch coverage
should be called condition coverage and clang region coverage
is branch coverage in fact(also known as *decision/C1*), right?
And llvm/clang will support all the following coverage