search for: corre

Displaying 20 results from an estimated 540 matches for "corre".

Did you mean: core
2009 Aug 16
2
bootstrapped correlation confint lower than -1 ?
Dear R users, Does the results below make any sense? Can the the interval of the correlation coefficient be between *-1.0185* and -0.8265 at 95% confidence level? Liviu > library(boot) > data(mtcars) > with(mtcars, cor.test(mpg, wt, met="spearman")) Spearman's rank correlation rho data: mpg and wt S = 10292, p-value = 1.488e-11 alternative hypothesis: tru...
2010 May 24
1
retrieve path analysis coefficients (package agricolae)
Dear list, I'd like to use path.analysis in the package agricolae in batch format on many files, retrieving the path coefficients for each run and appending them to a table. I don't see any posts in the help files about this package or the path.analysis package. I've tried creating an object out of the call to path.analysis, but no matter what I try, the function automatically prints
2010 Mar 05
1
Error in inherits(x, "data.frame") : subscript out of bounds
Hi, I have a list p with different size dataframes and length of over 8000. I'm trying to calculate correlations between the rows of dataframes of this list and columns of another dataset (type data.frame also) so that first column is correlated with all the rows in the list dataframe. Some information from another dataset is also included to the final output (all.corrs). This worked a couple of...
2010 May 28
2
problem with a function
Hi all, I have a function rho.f which gives a list of estimators. I have the following problems. rho.f(0.3) gives me the right answer. However, if I use rho.f(corr[4]) give me a different answer, even though corr[4]==0.3. This prevents me from using a for loop. Can someone give me some help? Thank you very much in advance. Hannah >
2010 Jan 30
2
convert data frame of values into correlation matrix
Hi Group, Consider a data frame like this: mylabel1 <- rep(c("A","B","C"),each=3) mylabel2 <- rep(c("A","B","C"),3) corrs <- c(1,.8,.7,.8,1,.7,.7,.7,1) myData <- data.frame(mylabel1,mylabel2,corrs) myData mylabel1 mylabel2 corrs 1 A A 1.0 2 A B 0.8 3 A C 0.7 4 B
2010 Jul 07
1
ifelse statement
Hi, I am a newbie of R, and playing with the "ifelse" statement. I have the following codes: ## first, for(i in 1:3) { for(j in 2:4) { cor.temp <- cor(iris.allnum[,i], iris.allnum[,j]) if(i==1 & j==2) corr.iris <- cor.temp else corr.iris <- c(corr.iris, cor.temp) } } this code is working fine. I also tried to perform the same thing in another way with "ifelse":
2010 Apr 16
3
problem with FUN in Hmisc::summarize
Hi all, I'd like to use the Hmisc::summarize function, but it uses a function (FUN) of a single vector argument to create the statistical summaries. Consider an easy case: I'd like to compute the correlation between two variables in my dataframe, grouped according to other variables in the same dataframe. For exemple, consider the following dataframe D: V1 V2 V3 A 1 -1 A 1 1 A -1 -1 B 1 1 B 1 1 I'd like to use Hmisc::summarize(X=D, by=llist(myvar=D$V1...
2006 Mar 25
2
Please help on correlation matrix
hi everyone, Suppose I have three variables a, b, and c each with 10 values. Now I construct a corr matrix for them. Now I want to give the names of columns of corr matrix as a, b, c, i.e. the first column of corr matrix will have name as ‘a’ second column with ‘b’ and so on. Can anyone give me any code by which I can automatically assign the names of columns of corr matrix which are
2005 Dec 03
1
Correlation matrix from a vector of pairwise correlations
I've a vector of pairwise correlations in the order low-index element precedes the high-index element, say: corr(1,2)=0.1, corr(1,3)=0.2, corr(2,3)=0.3, corr(3,4)=0.4 How can I construct the corresponding correlation matrix? I tried using the "combn"-function in "combinat" package: library(combinat) combn...
2005 Mar 02
1
Warning: number of items to replace is not a multiple of replacement length
...number of items to replace is not a multiple of replacement length 3: number of items to replace is not a multiple of replacement length 4: number of items to replace is not a multiple of replacement length Ultimately I need to be able to integrate this function, which isn't going to happen (correctly) if I've messed-up writing the function. Thanks for any advice on this. Regards, Lyle W. Konigsberg Professor of Anthropology University of Tennessee Knoxville, TN LyleK at utk.edu
2000 Mar 14
1
qr.solve (fwd)
...) They hava a function "corr.matrix" (see end of mail), and when they create a 173x173 matrix with this function V <- corr.matrix(0.3, n=173) V1 <- qr.solve(V) reports: Error in qr(a, tol = tol) : NA/NaN/Inf in foreign function call (arg 1) For n < 173, qr.solve returns the correct result. Torsten ________________________________________________________________________ corr.matrix <- function(d, n=100) { mat <- NULL for(i in 1:n) { mat <- c(mat,((1-i):(n-i))) } mat <- abs(mat) mat <- corr(mat,d) mat <- matrix(mat, ncol=n) mat } corr...
2010 Feb 12
1
popbio and stochastic lambda calculation
...ntially larger than published. The authors of the published example used a different method to calculate the CIs around lambda, but I would have expected the results of the vitalsim to be closer. (The authors used the 'delta' method from Caswell (2001)). My main questions are: 1. Have I correctly calculated stochastic lambda and its 95% CIs? 2. Why am I unable to use any distributions other than beta? What can I do about that? Thank you, Shawn Morrison ##################################################### #My example: ##################################################### rm(list =...
2009 Apr 19
1
help with this code
Hi, can anyone help me with the following code? Thanks! library(mvtnorm) f2 <- function(n, rho) { var <- matrix(c(1,rho,rho,1), nrow=2, ncol=2, byrow=T) beta <- seq(0, 1, length.out=n+1) alpha <- sort (sapply(1-beta, qnorm)) x <- array(0, dim=c(n, n)) for (s in 1:n) { for (t in 1:n){ if (s>=t) x[s,t] <- pmvnorm(lower=c(alpha[s],
2010 Jun 08
2
problem with if else statement
Dear colleagues, What did I not understand ? ->my intention I want to create a new variable: In plain language: If someone is taking anithypertensive treatment (med.hyper==1) table(med.hyper) med.hyper 0 1 472 97 I want to subtract 5 mmHg (rr.dia.2m-5) from the measured diastolic blood pressure (rr.dia.2m) if not treated - the value of the measured diastolic blood pressure should
2005 Apr 11
2
Trying to undo an assignment
Hi, I defined corr to be a function, not realising that this was also the name for correlation in package=boot. How do I explicitly call the corr function within package boot (so, scope up over the current frame, I guess is another way of saying it) without removing my new corr function ? Thanks, Tolga Please follow the attached hyperlink to an important disclaimer <http://www.c...
2013 Mar 04
1
How to loop several binary files from two directories?
I have two binary files(rasters) with the same dimensions. The first file is called `over` and the second is `corr`. I want to replace values in `over` by `NA` whenever `corr` is greater than 0.5. to read the two files we can use: conne <- file("C:corr.bin","rb") over <- readBin(conne, numeric(), size=4, n=1440*720, signed=TRUE) frf <-
2016 Apr 29
2
lm() with spearman corr option ?
Hi, A following function was kindly provided by GGally?s maintainer, Barret Schloerke. function(data, mapping, ...) { p <- ggplot(data = data, mapping = mapping) + geom_point(color = I("blue")) + geom_smooth(method = "lm", color = I("black"), ...) + theme_blank() + theme(panel.border=element_rect(fill=NA, linetype =
2008 Aug 13
2
Tiny help for tiny function
I just started to write tiny functions and therefore I appologise in advance if I am asking stupid question. I wrote a tiny function to give me back from the original matrix, a matrix showing only the values smaller -0.8 and bigger 0.8. y<-c(0.1,0.2,0.3,-0.8,-0.4,0.9) x<-c(0.5,0.3,0.9,-0.9,-0.7,0.3) XY<-rbind(x,y) extract.values<-function (x) { if(x>=0.8|x<=-0.8)x
2005 Sep 16
1
corr.test -- use a different null hypothesis
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 First of all, I'm a physicist and therefore I'm not much used to use statistics. So, please forgive me if this is a FAQ or stupid, but I failed to find the answer by myself. I want to use corr.test to test for the correlation of two data sets (actually I have a lot of data set and perform pairwise testing). But I wanted to find sets where the correlation is less than a certain limit, i.e. |r_exp| < r_0. As far as I can see corr.test is designed to work only for the null hypothesis r_exp = 0. I would need H0 as...
2008 May 15
1
logistic transformation using nlminb
...the minimisation I'm using nlminb and to satisfy the first 2 conditions the logistic transformation is used with box constraints for condition 3. However, I don't seem to be able to get the values x that i'm expecting from fitting a simpler model. For example, set.seed(0) # creating a correlation matrix corr <- diag(5) corr[lower.tri(corr)] <- 0.5 corr[upper.tri(corr)] <- 0.5 # Data for the minimisation mat <- rmvnorm(10000, mean=c(3, 2.75, 2.8, 3, 2.9), sd=c(0.1, 0.1,0.12, 0.15, 0.10), cov=corr) # here is the simple optimisation function that allows the 5th element to...