Displaying 20 results from an estimated 2000 matches similar to: "Questions on Mahalanobis Distance"
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
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),
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 =
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
2009 May 22
0
EM algorithm mixture of multivariate
Hi, i would to know, if someone have ever write the code to estimate the
parameter (mixing proportion, mean, a var/cov matrix) of a mixture of two
multivariate normal distribution. I wrote it and it works (it could find
mean and mixing proportion, if I fix the var/cov matrix), while if I fix
anything, it doesn't work. My suspect is that when the algorithm iterates
the var/cov matrix, something
2009 May 22
0
EM algorithm mixture of multivariate gaussian
Hi, i would to know, if someone have ever write the code to estimate the
parameter (mixing proportion, mean, a var/cov matrix) of a mixture of two
multivariate normal distribution. I wrote it and it works (it could find
mean and mixing proportion, if I fix the var/cov matrix), while if I fix
anything, it doesn't work. My suspect is that when the algorithm iterates
the var/cov matrix, something
2009 Jul 20
2
mahalanobis distance
http://www.nabble.com/file/p24569511/mahalanobis.txt mahalanobis.txt
http://www.nabble.com/file/p24569511/concentrations.txt concentrations.txt
Dear Forum members,
I have a problem calculating mahalanobis distances. My data file
mahalanobis.txt and categories file concentrations.txt are attached. I do
the following steps:
x <- as.matrix(read.table("mahalanobis.txt", header=TRUE))
2011 Sep 26
2
Mahalanobis Distance
Hello R helpers,
I'm trying to use Mahalanobis distance to calculate distance of two time
series, to make some comparations with euclidean distance, DTW, etc, but I'm
having some dificults.
I have, for example, two objects:
s.1 <- c( 5.6324702, 1.3994353, -3.2572327, -3.8311846, -1.2248719,
0.9894694, -2.2835332, -5.1969285, -5.2823988, -3.1499400, -1.7307950,
2.8221209,
2010 Jun 22
1
Mahalanobis distance
I am a new R user. i have a question about Mahalanobis distance.actually i have 300 rows and 7 columns. columns are different measurements, 300 rows are genes. since genes can
classify into 4 categories. i used dist() with euclidean distance and cmdscale to do MDS plot. but find out Mahalanobis distance may be
better. how do i use Mahalanobis() to generate similar dist object which i can use
2008 Dec 08
1
Clustering with Mahalanobis Distance
Dear R ExpeRts,
I'm having memory difficulties using mahalanobis distance to trying to cluster in R. I was wondering if anyone has done it with a matrix of 6525x17 (or something similar to that size). I have a matrix of 6525 genes and 17 samples. I have my R memory increased to the max and am still getting "cannot allocate vector of size" errors. My matrix "x" is
2007 Feb 20
1
Mahalanobis distance and probability of group membership using Hotelling's T2 distribution
I want to calculate the probability that a group will include a particular
point using the squared Mahalanobis distance to the centroid. I understand
that the squared Mahalanobis distance is distributed as chi-squared but that
for a small number of random samples from a multivariate normal population
the Hotellings T2 (T squared) distribution should be used.
I cannot find a function for
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
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
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)
2004 Sep 12
2
mahalanobis distance
Is there a function that calculate the mahalanobis distance in R .
The dist function calculates "euclidean"', '"maximum"', '"manhattan"',
'"canberra"',
'"binary"' or '"minkowski"'.
Thanks ../Murli
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
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 =
2010 Mar 03
1
cluster with mahalanobis distance
How can I perform cluster analysis using the mahalanobis distance instead of
the euclidean distance?
thank you
Naama Wolf
--
View this message in context: http://n4.nabble.com/cluster-with-mahalanobis-distance-tp1577038p1577038.html
Sent from the R help mailing list archive at Nabble.com.
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