search for: corrs

Displaying 20 results from an estimated 535 matches for "corrs".

Did you mean: cores
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: true rho is not
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
...'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 weeks ago when I wrote it but now it seems not to, and gives an error message: Error in inherits(x, "data.frame") : subscript out of bounds In addition: There were 50 or more warnings (use warnings() to see the first 50) warnings() Warning messages: 1: In co...
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 A 0.8 5 B B 1.0 6 B C 0.7 7 C A 0.7...
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
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(c(0.1,0.2,0.3,0.4),2) , but to no avail... Thank you for your
2005 Mar 02
1
Warning: number of items to replace is not a multiple of replacement length
I feel like a complete dolt, as I know this question has been asked by others on a fairly regular basis, but I'm going in circles trying to get the following to work: id.prob<-function (tt) { library(mvtnorm) #============================ Makeham<-function(tt) { a2=0.030386513 a3=0.006688287 b3=0.039047537 t<-tt-20 h.t<-a2+a3*exp(b3*t) S.t<-exp(-a2*t+a3/b3*(1-exp(b3*t)))
2000 Mar 14
1
qr.solve (fwd)
Two friend reported me a problem, which I can't solve: (I run R-1.0.0, Debian Linux) 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
2010 Feb 12
1
popbio and stochastic lambda calculation
Hello R users, I am trying to calculate the stochastic lambda for a published matrix population model using the popbio package. Unfortunately, I have been unable to match the published results. Can anyone tell me whether this is due to slightly different methods being used, or have I gone wrong somewhere in my code? Could the answer be as simple as comparing deterministic lambdas to
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
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
2008 May 15
1
logistic transformation using nlminb
Dear all, I want to find the optimal values of a vector, x (with 6 elements) say, satisfying the following conditions: 1. for all x>=0 2. sum(x)=1 3. x[5]<=0.5 and x[6]<=0.5 For 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