Displaying 20 results from an estimated 6000 matches similar to: "correlation significance testing with multiple factor levels"
2007 May 24
3
Problem with numerical integration and optimization with BFGS
Hi R users,
I have a couple of questions about some problems that I am facing with
regard to numerical integration and optimization of likelihood
functions. Let me provide a little background information: I am trying
to do maximum likelihood estimation of an econometric model that I have
developed recently. I estimate the parameters of the model using the
monthly US unemployment rate series
2004 Feb 17
2
Lattice graphics and strip function
I am looking for examples of code that demonstrates the fine tuning of
the strip panels in lattice graphics and uses plotmath characters. The
code for the graphic is as follows:
xyplot(lagy ~ n | rho1 * rho2, data= data, layout=c(2,6), span = 1,
xlab = "Sample Size", ylab = "Bias in the Coefficient for the Lag of X",
type = "o")
rho1 is a four level factor
2005 Nov 07
1
Newbie on functions
Hi,
I'm trying to write a simple function like
case1 <- function (m, cov, Q, R) {
theta <- (acos(R/sqrt(Q^3)))
beta <- (-2)*sqrt(Q)*cos(theta/3)+m[1]/3
rho1 <- (-2)*sqrt(Q)*cos((theta+2*pi)/3)+m[1]/3
rho2 <- (-2)*sqrt(Q)*cos((theta-2*pi)/3)+m[1]/3
stderrb <- deltamethod( ~(-2)*sqrt(Q)*cos(theta/3)+x1/3,m,cov)
stderrr1 <- deltamethod(
2010 Nov 18
1
how do I build panel data/longitudinal data models with AR terms using the plm package or any other package
Hi All,
I am doing econometric modeling of panel data (fixed effects). We currently use Eviews to do this, but I have discovered a bug in Eviews 7 and am exploring the use of R to build panel data models / longitudinal data models. I looked at the plm package but do not see how I can incorporate AR terms in the model using the plm package. I have an Eviews model with two AR terms, AR(1) and
2007 Jul 13
1
correlation matrix difference
Hi, I have got four correlation matrix. They are the same set of variables
under different conditions. Is there a way to test whether the correlation
matrix are significently different among each other? Could
anyone give me some advice?
--
View this message in context: http://www.nabble.com/correlation-matrix-difference-tf4073868.html#a11578046
Sent from the R help mailing list archive at
2008 Feb 08
0
User specified correlation structure (e.g., 2-banded Toeplitz)
Dear All:
I am trying to fit a special case of a 2-banded Toeplitz correlation
structure. A 2-banded Toeplitz has ones on the diagonal, a
correlation, RHO1, on the first off-diagonal, and a correlation, RHO2,
on the second off-diagonal, with zeros on all subsequent
off-diagonals. After reading relevant sections in Mixed-Effects
Models in S and S-PLUS (Pinheiro & Bates, 2000) and searching
2008 Feb 08
0
User-specified correlation structure (e.g., 2-banded Toeplitz)
Dear All:
I am trying to fit a special case of a 2-banded Toeplitz correlation
structure. A 2-banded Toeplitz has ones on the diagonal, a
correlation, RHO1, on the first off-diagonal, and a correlation, RHO2,
on the second off-diagonal, with zeros on all subsequent
off-diagonals. After reading relevant sections in Mixed-Effects
Models in S and S-PLUS (Pinheiro & Bates, 2000) and searching
2008 Jun 26
2
constructing arbitrary (positive definite) covariance matrix
Dear list,
I am trying to use the 'mvrnorm' function from the MASS package for
simulating multivariate Gaussian data with given covariance matrix.
The diagonal elements of my covariance matrix should be the same,
i.e., all variables have the same marginal variance. Also all
correlations between all pair of variables should be identical, but
could be any value in [-1,1]. The problem I am
2007 Mar 23
1
generating lognormal variables with given correlation
Dear R users
I use simulated data to evaluate a model by sampling the parameters in
my model from lognormal distributions.
I would like these (lognormal distributed) parameters to be correlated,
that is, I would like to have pairwise samples of 2 parameters with a
given correlation coefficient.
I have seen that a covariance matrix can be fixed when generating random
variables from a
2007 Jul 16
1
question about ar1 time series
Hello everybody,
I recently wrote a "program" that to generate AR1 time series, here the code:
#By Jomopo. Junio-2007, Leioa, Vizcaya
#This program to create the AR1 syntetic series (one by one)
#Where the mean is zero, but the variance of the serie AR1 and
#the coef. of AR1 are be changed. If var serie AR1 = 1 then is standarized!
#Final version for AR1 time series program
#Mon Jul
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
2003 Jul 30
3
nested for() loops for returning a nearest point
I'm trying to do the following:
For each ordered pair of a data frame (D1) containing longitudes and
latitudes and unique point IDs, calculate the distance to every point in
another data frame (D2) also containing longitudes, latitudes and point
IDs, and return to a new variable in D1 the point ID of the nearest
element of D2.
Dramatis personae (mostly self-explanatory):
D1$long
2004 Jun 25
2
Simulating from a Multivariate Normal Distribution Using a Correlation Matrix
Hello,
I would like to simulate randomly from a multivariate normal distribution using a correlation
matrix, rho. I do not have sigma. I have searched the help archive and the R documentation as
well as doing a standard google search. What I have seen is that one can either use rmvnorm in
the package: mvtnorm or mvrnorm in the package: MASS. I believe I read somewhere that the latter
was
2007 Jun 12
4
Generating artificial datasets with a specific correlation coefficient.
I need to create artificial datasets with specific correlation
coefficients (i.e. a dataset that returns r = 0.30, etc.) as examples
for a lab I am teaching this summer. Is there a way to do that in R?
Thanks.
Jim Milks
Graduate Student
Environmental Sciences Ph.D. Program
136 Biological Sciences
Wright State University
3640 Colonel Glenn Hwy
Dayton, OH 45435
[[alternative HTML version
2007 Nov 16
1
generate multivariate F with specified correlation matrix
Dear all,
In MATLAB, to generate multivariate F with specified correlation matrix Pn I can use the code such as
Z = mvnrnd([0 0 0 0 0], Pn, N);
U = normcdf(Z,0,1);
X = [finv(U(:,1),5,15) finv(U(:,2),5,15) finv(U(:,3),5,15) finv(U(:,4),5,15) finv(U(:,5),5,15)];
Is there something similar in R?
Thank you for your time.
2011 May 16
3
Simulating correlations with varying sample sizes
Hi there,
I would like to draw 10 correlations from a bivariate population - but every
draw should be done with a different sample size. I thought I could to this
with a loop:
r=numeric(10) #Goal vector
N = c(1000,100,80,250,125,375,90,211,160,540) #Sample size vector
for(i in 1:10) {
data <- mvrnorm(n=N,mu=c(0,0),Sigma=matrix(c(1,.3,.3,1),2))
r[i] <- cor(data[,1],data[,2])
}
2006 Sep 27
1
Testing the equality of correlations
Dear All,
I wonder if there is any implemented statistical test in R to test the equality between many correlations. As an example, let X1, X2, X3 X4 be four random variables. let
Phi(X1,X2) , Phi(X1,X3) and Phi(X1,X4) be the corresponding correlations.
How to test Phi(X1,X2) = Phi(X1,X3) = P(X1,X4)?
Many thanks in advance,
Bernard
2012 Oct 12
0
Creating a correlation matrix with significance levels
Hi there,
I tried this code from homepage:
http://myowelt.blogspot.de/2008/04/beautiful-correlation-tables-in-r.html
<http://myowelt.blogspot.de/2008/04/beautiful-correlation-tables-in-r.html>
corstarsl <- function(x){
require(Hmisc)
x <- as.matrix(x)
R <- rcorr(x)$r
p <- rcorr(x)$P
## define notions for significance levels; spacing is important.
mystars <- ifelse(p <
2008 Nov 11
1
simulate data with binary outcome and correlated predictors
Hi,
I would like to simulate data with a binary outcome and a set of predictors that are correlated. I want to be able to fix the number of event (Y=1) vs. non-event (Y=0). Thus, I fix this and then simulate the predictors. I have 2 questions:
1. When the predictors are continuous, I can use mvrnorm(). However, if I have continuous, ordinal and binary predictors, I'm not sure how to simulate
2005 Jan 17
1
pairs: altering pch options on upper and lower panel of pairwise scatter plots
Hello,
I can't figure out how to use the upper.panel and lower.panel options in
pairs to alter the label options for either panel independently of the
other.
I would like to be able to show the pairwise scatter plots for the data
as they are (a vanilla pairs plot?) but separately to be able to label
the points according to a factor level. It is easy enough to do this
independently, but I