similar to: extracting values from correlation matrix

Displaying 20 results from an estimated 500 matches similar to: "extracting values from correlation matrix"

2023 Nov 15
1
Cannot calculate confidence intervals NULL
I believe the problem is here: cor1 <- cor(x1, y1, method="spearman") cor2 <- cor(x2, y2, method="spearman") The x's and y's are not looked for in data (i.e. NSE) but in the environment where the function was defined, which is standard evaluation. Change the above to: cor1 <- with(d, cor(x1, y1, method="spearman")) cor2 <- with(d, cor(x2, y2,
2008 Aug 04
1
simulate data based on partial correlation matrix
Given four known and fixed vectors, x1,x2,x3,x4, I am trying to generate a fifth vector,z, with specified known and fixed partial correlations. How can I do this? In the past I have used the following (thanks to Greg Snow) to generate a fifth vector based on zero order correlations---however I'd like to modify it so that it can generate a fifth vector with specific partial
2023 Nov 15
2
Cannot calculate confidence intervals NULL
R-Experts, Here below my R code working without error message but I don't get the results I am expecting. Here is the result I get: [1] "All values of t are equal to 0.28611928397257 \n Cannot calculate confidence intervals" NULL If someone knows how to solve my problem, really appreciate. Best, S ######################################################### # Difference in Spearman
2010 May 03
1
Comparing the correlations coefficient of two (very) dependent samples
Hello all, I believe this can be done using bootstrap, but I am wondering if there is some other way that might be used to tackle this. #Let's say I have two pairs of samples: set.seed(100) s1 <- rnorm(100) s2 <- s1 + rnorm(100) x1 <- s1[1:99] y1 <- s2[1:99] x2 <- x1 y2 <- s2[2:100] #And both yield the following two correlations: cor(x1,y1) # 0.7568969 (cor1) cor(x2,y2)
2010 Jan 29
2
Vectors with equal sd but different slope
Hi, what I would need are 2 vector pairs (x,y) and (x1,y1). x and x1 must have the same sd. y and y1 should also exhibit the same sd's but different ones as x and x1. Plotting x,y and x1,y1 should produce a plot with 2 vectors having a different slope. Plotting both vector pairs in one plot with fixed axes should reveal the different slope. many thanks syrvn -- View this message in
2007 Sep 26
2
generate fourth vector based on known correlations
I am trying to generate a fourth vector,z, given three known and fixed vectors, x1,x2,x3 with corresponding known and fixed correlations with themeselves and with z. That is, all correlations are known and prespecified. How can I do this? Thank you, ben
2010 Aug 25
1
SEM : Warning : Could not compute QR decomposition of Hessian
Hi useRs, I'm trying for the first time to use a sem. The model finally runs, but gives a warning saying : "In sem.default(ram = ram, S = S, N = N, param.names = pars, var.names = vars, : Could not compute QR decomposition of Hessian. Optimization probably did not converge. " I found in R-help some posts on this warning, but my attemps to modify the code didn't change
2005 Jul 13
1
help: how to plot a circle on the scatter plot
Hello, I have a data set with 15 variables, and use "pairs" to plot the scatterplot of this data set. Then I want to plot some circles on the small pictures with high correlation(e.g. > 0.9). First, I use "cor" to obtain the corresponding correlation matrix (x) for this scatterplot. Second, use "seq(along = x)[x > 0.9]" to find the positions of the small
2003 Feb 19
1
getting/storing the name of an object passed to a function
Hi I have a couple of functions that work on the object created by another R command and then print out or summarise the results of this work. The main function is defined as: hotelling.t <- function(obj) { #internal commands } I then have print.hotelling.t() that takes the list returned by hotelling.t and prints it with some extra significance calculations, formatting, etc. I want to
2010 Sep 30
2
panel.pairs in splom
Hello, I have a customized pairs () fonction as follows that displays correctely my data. ------------------------------------------------------------------------ panel.cor1 <- function (x, y, digits=2, prefix="") { usr <- par("usr"); on.exit(par(usr)) par(usr = c(0, 1, 0, 1)) r <- cor(x, y,use="pairwise.complete.obs",
2004 Nov 16
5
Difference between two correlation matrices
Hi Now a more theoretical question. I have two correlation matrices - one of a set of variables under a particular condition, the other of the same set of variables under a different condition. Is there a statistical test I can use to see if these correlation matrices are "different"? Thanks Mick
2013 Mar 31
1
How to represent certain values in a file as we want?
I have a raster file(1440*720 rows) contains values of 1 ,2 , and 3. when I plot the file , I got a map of three colors but I do not know which is which. How can I put those colors as as I want : 1=red 2=blue 3=green code: pvm <- file("C:\\User_sm-das.bin","rb") cor1<- readBin(pvm, numeric(), size=4, n=1440*720, signed=TRUE) r <-raster(t(matrix((data=cor1),
2000 Mar 28
1
loess.smooth dumps core
Has the loess.smooth() function changed? It used to work, but now it causes R to abort with a segmentation fault. I stole the function points.lines() from V&R 1st ed. pp. 67--68, but now it only works if I remove the line with loess.smooth. Here's the function I'm using: points.lines <- function(x, y, ...) { cor1 <-round(cor(x, y, use="pairwise"), digits=2)
2011 Jan 28
1
Please help -- Converting a 2D matrix to 3 columns for graphical representation
Hi, I am trying to convert a 2D correlation matrix to 3 columns for graphical representation: rdata = replicate(100, rnorm(15)) #construct a 2D matrix c1 = cor(rdata) #outputs a correlation matrix Now I want to convert the 2D c1 to (row#, col#, correlation) 1 1 cor1 1 2 cor2 1 3 cor3 ... 2 1 cor.. Is there a way to do this? The main reason I am doing this is to find a correlation based graph
2012 May 31
0
ignore NA column in a DF (for calculation) without removing them
Dear users, I have for the moment a function which looks for the best correlation for each file I have in my correlation matrix. I'm working on a list.files. Here's the function: get.max.cor <- function(station, mat){ mat[row(mat) == col(mat)] <- -Inf which( mat[station, ] == max(mat[station, ],na.rm=TRUE) ) } If I have a correlation matrix like this
2005 Nov 01
2
Greek letters in plots
Hi, all. I know that this is probably something that others have asked, but I can't find a reference in either the FAQ or the help pages. I'm trying to find a way to put Greek letters as a label of the plot *with* a value from the data. Previously I've used pasted and the word "rho". * paste("rho=", cor2[i]) will produce a label of
2009 Dec 04
2
selective subsetting of a correlation matrix
Dear All, I have a correlation matrix say 'M' (4000x4000) for 4000 genes and I want to subset it to 'N' (190x190) for 190 genes. The list of those 190 genes are in variable 't'. So the idea is to read the names of genes from variable 't' and subset the matrix M accordingly. Any thoughts are welcome! Best Lee [[alternative HTML version deleted]]
2012 Dec 03
4
How to calculate the spatial correlation of several files?
dir1 <- list.files("C:\\Users\\aalyaari\\Desktop\\cor", "*.bin", full.names = TRUE) dir2 <- list.files("C:\\Users\\aalyaari\\Desktop\\cor2", "*.bin", full.names = TRUE) results <- list() for (.files in dir1){ # read in the 365 files as a vector of numbers for dir1 file1 <- do.call(rbind,(lapply(.files, readBin ,
2006 May 24
7
Using inline editor without requiring a URL
Hi, I was wondering if anyone has implemented the inplace editor without the need for the URL. I have tried this but run into a problem in that the ''saving...'' text in shown for ever and the label is no longer editable. Can I also confirm that my idea of the callback function is something that runs before the value is passed to the URL (if you were to use one). What might be
2010 Mar 24
3
help in matlab - r code
Dear list members, I need to translate 3 lines of matlab code to R (a loop, to be specific), and I don't know what would be the results in matlab or how to do it in R-- I don't realise if they are doing to the col, vector or what. if the results are a vector or a value or a matrix :-( Anyone with matlab, can run it and give me the result? Any ideias what am I doing wrong? The code is