search for: cmats

Displaying 20 results from an estimated 55 matches for "cmats".

Did you mean: mats
2007 Nov 22
2
Vectorize a correlation matrix
Hello I can construct a correlation matrix from an (ordered) vector of correlation coefficients as follows: x <- c(0.1,0.2,0.3,0.4,0.5) n <- length(x) cmat <- diag(rep(0.5,n)) cmat[lower.tri(cmat,diag=0)] <- x cmat <- cmat+t(cmat) But how to do the reverse operation, i.e. produce x from cmat? Thanks for help, Serguei Kaniovski [[alternative HTML version deleted]]
2005 Apr 21
1
printCoefmat(signif.legend =FALSE) (PR#7802)
printCoefmat(signif.legend =FALSE) does not work properly. The option "signif.legend = FALSE" is ignored as shown in the example below. cmat <- cbind(rnorm(3, 10), sqrt(rchisq(3, 12))) cmat <- cbind(cmat, cmat[,1]/cmat[,2]) cmat <- cbind(cmat, 2*pnorm(-cmat[,3])) colnames(cmat) <- c("Estimate", "Std.Err", "Z value", "Pr(>z)") #
2002 Apr 09
1
Problem handling NA indexes for character matrixes (PR#1447)
In a package I've been developing for manipulating genetic data I discovered a problem when indexing into character arrays using NA's: Create a character matrix and a numeric matrix > cmat <- matrix( letters[1:4], ncol=2, nrow=2) > nmat <- matrix( 1:4, ncol=2, nrow=2) Create an index vector containing an NA value > indvec <- c(1,2,NA) Indexing works fine for both
2006 Dec 04
1
Count cases by indicator
Hi, In the data below, "case" represents cases, "x" binary states. Each "case" has exactly 9 "x", ie is a binary vector of length 9. There are 2^9=512 possible combinations of binary states in a given "case", ie 512 possible vectors. I generate these in the order of the decimals the vectors represent, as:
2007 May 19
2
What's wrong with my code ?
I try to code the ULS factor analysis descrbied in ftp://ftp.spss.com/pub/spss/statistics/spss/algorithms/ factor.pdf # see PP5-6 factanal.fit.uls <- function(cmat, factors, start=NULL, lower = 0.005, control = NULL, ...) { FAfn <- function(Psi, S, q) { Sstar <- S - diag(Psi) E <- eigen(Sstar, symmetric = TRUE, only.values = TRUE) e <- E$values[-(1:q)] e <-
2008 Apr 29
0
Looking for Post-hoc tests (a la TukeyHSD) or interaction-level independent contrasts for survival analysis.
Hello all R-helpers, I've performed an experiment to test for differential effects of elevated temperatures on three different groups of corals. I'm currently performing a cox proportional hazards regression with censoring on the survivorship (days to mortality) of each individual in the experiment with two factors: Temperature Treatment (2 levels: ambient and elevated) and
2010 Oct 08
3
Efficiency Question - Nested lapply or nested for loop
My data looks like this: > data name G_hat_0_0 G_hat_1_0 G_hat_2_0 G_0 G_hat_0_1 G_hat_1_1 G_hat_2_1 G_1 1 rs0 0.488000 0.448625 0.063375 1 0.480875 0.454500 0.064625 1 2 rs1 0.002375 0.955375 0.042250 1 0.000000 0.062875 0.937125 2 3 rs2 0.050375 0.835875 0.113750 1 0.877250 0.115875 0.006875 0 4 rs3 0.000000 0.074750 0.925250 2 0.897750 0.102000
2008 Nov 21
2
Extracting diagonal matrix
Dear All, I have a correlation matrix of size 100 x 100 and would like to extract the diagonal matrix from it. I have used the for loop to store tha correlation values of the diagonal matrix. Is there a 'R way' of doing this? Thanks in advance. Kind regards, Ezhil
2005 Jun 26
0
Factor correlations in factanal
Dear R-devel list members, Ben Fairbank draw it to my attention that factanal() (in the stats package) doesn't report factor correlations for oblique rotations. Looking at the source, I see that factanal also doesn't save the factor-transformation (rotation) matrix from which these correlations can be computed. I've modified the source, attached below, so that the transformation
2002 Mar 06
2
Announce: R from Python
Hello. I'm not a regular subscriber in this mailing list, but I think that this announce may interest somebody. Please, forgive me if this is the wrong place. Based on the code of RSPython, but modifying it a little, I wrote an interface for using R from Python. The main reason for writing it was to make it robust, in order to avoid segmentation faults. Also, it is (IMMO) a very
2017 Oct 22
2
Syntax for fit.contrast
I have a model (run with glm) that has a factor, type. Type has two levels, "general" and "regional". I am trying to get estimates (and SEs) for the model with type="general" and type ="regional" using fit.contrast but I can't get the syntax of the coefficients to use in fit.contrast correct. I hope someone can show me how to use fit.contrast, or some
2009 Jul 10
1
problems with contrast matrix
Dear lme and lmer -ers, I have some problems using "home-made" contrast matrix in lme and lmer. I did an experiment to investigate the relationship between the response of an animal and some factors, namely the light wavelength (WA), the light intensity to which this animal was exposed and the sex of the animal tested. - The response can be a variable LA (normal distribution) or
2009 Feb 12
3
get top 50 correlated item from a correlation matrix for each item
Hi, I have a correlation matrix of about 3000 items, i.e., a 3000*3000 matrix. For each of the 3000 items, I want to get the top 50 items that have the highest correlation with it (excluding itself) and generate a data frame with 3 columns like ("ID", "ID2", "cor"), where ID is those 3000 items each repeat 50 times, and ID2 is the top 50 correlated items with ID,
2010 Dec 06
1
use pcls to solve least square fitting with constraints
Hi, I have a least square fitting problem with linear inequality constraints. pcls seems capable of solving it so I tried it, unfortunately, it is stuck with the following error: > M <- list() > M$y = Dmat[,1] > M$X = Cmat > M$Ain = as.matrix(Amat) > M$bin = rep(0, dim(Amat)[1]) > M$p=qr.solve(as.matrix(Cmat), Dmat[,1]) > M$w = rep(1, length(M$y)) > M$C = matrix(0,0,0)
2001 Aug 31
2
contrasts in lm
I've been playing around with contrasts in lm by specifying the contrasts argument. So, I want to specify a specific contrast to be tested Say: > y _ rnorm(100) > x _ cut(rnorm(100, mean=y, sd=0.25),c(-3,-1.5,0,1.5,3)) > reg _ lm(y ~ x, contrasts=list(x=c(1,0,0,-1))) > coef(reg)[2] x1 -1.814101 I was surprised to see that I get a different estimate for the
2008 Nov 24
3
Help With Permutations
I have a problem with permutations functions in R I just started using R so maybe it is an easy question I need to obtain all the 9.somthingExp 157 permutations that can be given from the number from 1 to 100 I wrote the following commands: > library(gregmisc) >options(expressions=1e5) cmat <- combinations(300,2) dim(cmat) # 44850 by 2 >permutations(n=100, r=100)
2017 Oct 22
0
Syntax for fit.contrast
> On Oct 22, 2017, at 6:04 AM, Sorkin, John <jsorkin at som.umaryland.edu> wrote: > > I have a model (run with glm) that has a factor, type. Type has two levels, "general" and "regional". I am trying to get estimates (and SEs) for the model with type="general" and type ="regional" using fit.contrast ?fit.contrast No documentation for
2009 May 26
2
Linear Regression with Constraints
Hi! I am a bit new to R. I am looking for the right function to use for a multiple regression problem of the form: y = c1 + x1 + (c2 * x2) - (c3 * x3) Where c1, c2, and c3 are the desired regression coefficients that are subject to the following constraints: 0.0 < c2 < 1.0, and 0.0 < c3 < 1.0 y, x1, x2, and x3 are observed data. I have a total of 6 rows of data in a data set. Is
2006 Mar 15
3
Help on factanal.fit.mle
Hi Can anybody please suggest me about the documentation of "factanal.fit.mle()" (Not factanal()------ searching factanal.fit.mle() in R always leads to factanal()). Is there any function for doing principal component factor analysis in R. Regards Souvik Bandyopadhyay JRF, Dept Of Statistics Calcutta University [[alternative HTML version deleted]]
2008 Sep 09
1
Addendum to wishlist bug report #10931 (factanal) (PR#12754)
--=-hiYzUeWcRJ/+kx41aPIZ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Hi, on March 10 I filed a wishlist bug report asking for the inclusion of some changes to factanal() and the associated print method. The changes were originally proposed by John Fox in 2005; they make print.factanal() display factor correlations if factanal() is called with rotation =