similar to: Fitting the best line to the plot of distance vs. correlation matrix

Displaying 20 results from an estimated 6000 matches similar to: "Fitting the best line to the plot of distance vs. correlation matrix"

2007 Aug 01
1
Reading Matrices
Dear all, I have been successful so far in plotting matrices and getting the regression line. But, as the matrices contains values like 1 and 0 (diagonal line) which is actually not needed as they are for the same gene, is creating bias in my regression line. I wish to neglect that part of the matrix and read the rest and plot the matrices again. I am attaching two matrices here for your
2013 Mar 12
1
Cook's distance
Dear useRs, I have some trouble with the calculation of Cook's distance in R. The formula for Cook's distance can be found for example here: http://en.wikipedia.org/wiki/Cook%27s_distance I tried to apply it in R: > y <- (1:400)^2 > x <- 1:100 > lm(y~x) -> linmod # just for the sake of a simple example >
2011 Feb 09
2
Generate multivariate normal data with a random correlation matrix
Hi All. I'd like to generate a sample of n observations from a k dimensional multivariate normal distribution with a random correlation matrix. My solution: The lower (or upper) triangle of the correlation matrix has n.tri=(d/2)(d+1)-d entries. Take a uniform sample of n.tri possible correlations (runi(n.tr,-.99,.99) Populate a triangle of the matrix with the sampled correlations Mirror the
2017 Dec 31
1
Perform mantel test on subset of distance matrix
I'm trying to perform a mantel test that ignores specific pairs in my distance matrices. The reasoning is that some geographic distances below a certain threshold suffer from spatial autocorrelation, or perhaps ecological relationships become less relevant that stochastic processes above a certain threshold. The problem is that I can't find a way to do it. If I replace values in either or
2011 Oct 18
1
cygwing warming when creating a package in windows
Dear All, I am a beginner creating R packages. I followed the Leisch (2009) tutorial and the document ?Writing R Extensions? to write an example. I installed R 2.12.2 (I also tried R2.13.2), the last version of Rtools and the recommended packages in a PC with Windows 7 Home Premium. I can run R CMD INSTALL linmod in the command prompt and the R CMD check linmod. The following outputs are
2007 Aug 07
1
Error in as.double.default(x) : (list) object cannot be coerced to 'double'
Dear experts, I have in all 14 matrices which stands for gene expression divergence and 14 matrices which stands for gene sequence divergence. I have tried joining them by using the concatanation function giving SequenceDivergence <- c(X1,X2,X3,X4,X5,X6,X7,X8,X9,X10,X11,X12,X13,X14) ExpressionDivergence <- c(Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8,Y9,Y10,Y11,Y12,Y13,Y14) where X1,X2..X14 are the
2006 Jun 28
1
Simulate dichotomous correlation matrix
Newsgroup members, Does anyone have a clever way to simulate a correlation matrix such that each column contains dichotomous variables (0,1) and where each column has different prevalence rates. For instance, I would like to simulate the following correlation matrix: > CORMAT[1:4,1:4] PUREPT PTCUT2 PHQCUT2T ALCCUTT2 PUREPT 1.0000000 0.5141552 0.1913139 0.1917923 PTCUT2
2007 Aug 07
0
plotting series of matrices on a single plot.
Dear experts, I have in all 14 matrices which stands for gene expression divergence and 14 matrices which stands for gene sequence divergence. I have tried joining them by using the concatanation function giving SequenceDivergence <- c(X1,X2,X3,X4,X5,X6,X7,X8,X9,X10,X11,X12,X13,X14) ExpressionDivergence <- c(Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8,Y9,Y10,Y11,Y12,Y13,Y14) where X1,X2..X14 are the
2009 Oct 26
2
What is the most efficient practice to develop an R package?
I am reading Section 5 and 6 of http://cran.r-project.org/doc/contrib/Leisch-CreatingPackages.pdf It seems that I have to do the following two steps in order to make an R package. But when I am testing these package, these two steps will run many times, which may take a lot of time. So when I still develop the package, shall I always source('linmod.R') to test it. Once the code in
2005 Oct 19
1
clustering algorithm detail
Hi all, I wanted to run the hclust (or any other clustering algorithm) on a distance matrix. I have formed the distance matrix as: distmat: a b c d e a 0.00 0.96 1.60 1.60 1.68 b 0.96 0.00 0.96 1.80 2.64 c 1.60 0.96 0.00 0.84 1.80 d 1.60 1.80 0.84 0.00 0.96 e 1.68 2.64 1.80 0.96 0.00
2008 Aug 06
1
Correlation dichotomous factor, continous (numerical) and ordered factor
Hello R-User! I appologise in advance if this should also go into statistics but I am presently puzzled. I have a data.frame (about 300 rows and about 80 variables) and my variables are dichotomous factors, continuous (numerical) and ordered factors. I would like to calculate the linear correlation between every pair of my variables, because I would like to perform a logistic regression (glm())
2006 Jan 11
1
updating formula inside function
Dear R-Helpers Given a function like foo <- function(data,var1,var2,var3) { f <- formula(paste(var1,'~',paste(var2,var3,sep='+'),sep='')) linmod <- lm(f) return(linmod) } By typing foo(mydata,'a','b','c') I get the result of the linear model a~b+c. How can I rewrite the function so that the formula can be updated inside the function,
2011 Jan 17
0
(no subject)
Dear R community,and especially Giovanni Millo, For my master's thesis i need to simulate a panel data with the fixed effects correlated with the predicor, so i run the the following code: set.seed(1970) #######################Panel data simulation with alphai correlated with xi##################################### n <- 5 t <- 4 nt <- n*t pData <- data.frame(id =
2011 Jan 17
0
PANEL DATA SIMULATION(sorry for my previous email with no subject)
Dear R community,and especially Giovanni Millo, For my master's thesis i need to simulate a panel data with the fixed effects correlated with the predicor, so i run the the following code: set.seed(1970) #######################Panel data simulation with alphai correlated with xi##################################### n <- 5 t <- 4 nt <- n*t pData <- data.frame(id =
2011 Jan 18
0
Need help in a simulation study
Dear R community,and especially Giovanni Millo, For my master's thesis i need to simulate a panel data with the fixed effects correlated with the predicor, so i run the the following code: set.seed(1970) #######################Panel data simulation with alphai correlated with xi##################################### n <- 5 t <- 4 nt <- n*t pData <- data.frame(id =
2011 Jan 17
0
PANEL DATA SIMULATION
Dear R community,and especially Giovanni Millo, For my master's thesis i need to simulate a panel data with the fixed effects correlated with the predicor, so i run the the following code: set.seed(1970) #######################Panel data simulation with alphai correlated with xi##################################### n <- 5 t <- 4 nt <- n*t pData <- data.frame(id =
2010 Apr 27
3
Problem calculating multiple regressions on a data frame.
Hi there, I am stuck trying to solve what should be a fairly easy problem. I have a data frame that essentially consists of (ID, time as seqMonth, variable, value) and i want to find the regression coefficient of value vs time for each combination of ID and Variable. I have tried several approaches and none of them seems to work as i expected. For example, i have tried:
2013 May 01
1
help understanding hierarchical clustering
Hi All, i've problem to understand how to work with R to generate a hierarchical clustering my data are in a csv and looks like : idcode,count,temp,sal,depth_m,subs 16001,136,4.308,32.828,63.46,47 16001,109,4.31,32.829,63.09,49 16001,107,4.302,32.822,62.54,47 16001,87,4.318,32.834,62.54,48 16002,82,4.312,32.832,63.28,49 16002,77,4.325,32.828,65.65,46 16002,77,4.302,32.821,62.36,47
2002 Jan 15
1
acf conf intervals +speed
Hi, I'm trying to obtain confidence intervals for auto and cross correlation estimates. I've adapted code made available by Stock and Watson that uses the Bartlett Kernel and the delta method. In R it runs really, really slow because of the loops it uses and I have 9 series that I'd like to examine (81 total combinations). It was easy enough to replace one of the while loops with a
2012 May 29
2
setting parameters equal in lm
Forgive me if this is a trivial question, but I couldn't find it an answer in former forums. I'm trying to reproduce some SAS results where they set two parameters equal. For example: y = b1X1 + b2X2 + b1X3 Notice that the variables X1 and X3 both have the same slope and the intercept has been removed. How do I get an estimate of this regression model? I know how to remove the intercept