Displaying 5 results from an estimated 5 matches for "corrmat".
Did you mean:
cormat
2010 Jan 30
2
convert data frame of values into correlation matrix
...A 1.0
2 A B 0.8
3 A C 0.7
4 B A 0.8
5 B B 1.0
6 B C 0.7
7 C A 0.7
8 C B 0.7
9 C C 1.0
I would like to find a general way to get this matrix from the above dataframe.
corrmat <- matrix(corrs,nrow=3,byrow=TRUE)
row.names(corrmat) <- c("A","B","C")
colnames(corrmat) <- c("A","B","C")
corrmat
A B C
A 1.0 0.8 0.7
B 0.8 1.0 0.7
C 0.7 0.7 1.0
The solution I have is the one above where I rearrange th...
2010 Apr 13
0
Error using reshape method
...ning message: "Error in d[, timevar] <- times[1L] : subscript out of
bounds"
The program:
library(QRMlib)
library(Hmisc)
ss<-5
mu<- c(0,2,3,12)
mu2<- c(0,2,10,20)
dims<- 4
co<- c(.3,.4,.5,.4,.3,.2)
replis<- 3
stdev<-c(1,2,5,10)
#1st set
corrmat <- matrix(1, dims, dims)
corrmat[upper.tri(corrmat)]<-co
selectlow <- lower.tri(corrmat)
corrmat[selectlow] <- t(corrmat)[selectlow]
sigma<- diag(stdev) %*% corrmat %*% diag(stdev)
simu1<-rmnorm(n=ss, Sigma=sigma, mu=mu, d=dims, rho=co)
simu11&l...
2007 Feb 12
0
Colouring the polygons, correlation matrix
...), -N:0/N, -(N/2):(N/2)/(N/2), pos=4)
}
options(digits=2)
#--NAMES
namjid<-c("mike", "tommy", "clara", "silvio", "jimmy", "jeffrey", "carl",
"randy", "tara")
njid<-length(namjid)
#--CORRELATION MATRIX
corrmat<-diag(rep(0.5,njid))
corrmat[lower.tri(corrmat,diag=0)]<-runif(choose(njid,2),-1,1)
corrmat<-corrmat1+t(corrmat)
#--CALL
cor.plot(mat=corrmat, dens=4, ticks=namjid, main="")
[[alternative HTML version deleted]]
2004 Sep 23
7
decompose a correlation matrix
Is there a simple way to decompose the upper triangle
of a correlation matrix to a linear list;
For example:
X Y Z
X 1 2 3
Y 2 1 4
Z 3 4 1
so you get a list like:
xy 2
XZ 3
YZ 4
I suspect you can do it with a matrix transformation, but
that beyond me at present.
Many thanks
Mark
_________________________
Department of Molecular and Human Genetics,
Baylor College of Medicine,
2003 Jul 21
1
Analysis of Complex Survey Data
Hi all
I would like to perform a logistic regression analysis on some complex survey data with R, but am not sure if there are functions within R that will
enable me to do so.
Also, are there any extensions of the "cor" function that would enable me to incorporate survey weights when calculating correlation coefficients for
bivariate data.
Any help on this matter will be greatly