Displaying 20 results from an estimated 5000 matches similar to: "Simulating correlated distributions"
1999 Jul 27
1
S+ files
A very basic question:
How can I make R read some S+ files that I had originally. The source
command says "file format unknown"
Thanks
Coomaren
........................................................................
........................................................
Dr Coomaren P Vencatasawmy
Senior Research Fellow
Spatial Modelling Centre (SMC)
P.O. Box 839
S-981 28
Kiruna
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
2012 Dec 02
2
How to simulate correlated data
Hello there,
I would like to simulate X --Normal (20, 5)
Y-- Normal (40, 10)
and the correlation between X and Y is 0.6. How do I do it in R?
Thank you very much
-----
TO GET MORE DETAILS CLICK HERE
--
View this message in context: http://r.789695.n4.nabble.com/How-to-simulate-correlated-data-tp4651667.html
Sent from the R help mailing list archive at
2005 Dec 01
1
Simulate Correlated data from complex sample
Dear List:
I have created some code to simulate data from a complex sample where
5000 students are nested in 50 schools. My code returns a dataframe with
a variable representing student achievement at a single time point. My
actual code for creating this is below.
What I would like to do is generate a second column of data that is
correlated with the first at .8 and has the same means within
2005 Dec 15
5
How to simulate correlated data
Hello there,
I would like to simulate X --Normal (20, 5)
Y-- Normal (40, 10)
and the correlation between X and Y is 0.6. How do I do it in R?
Thank you very much
Lisa Wang Msc.
Princess Margaret Hospital
Toronto, Ca
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
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])
}
2010 Feb 28
1
Gradient Boosting Trees with correlated predictors in gbm
Dear R users,
I’m trying to understand how correlated predictors impact the Relative
Importance measure in Stochastic Boosting Trees (J. Friedman). As Friedman
described “ …with single decision trees (referring to Brieman’s CART
algorithm), the relative importance measure is augmented by a strategy
involving surrogate splits intended to uncover the masking of influential
variables by others
2012 Jul 04
2
How to generate a correlated binary data set?
Hi.
I am trying to generate a correlated binary data set.
I've tried to use mvtBinaryEP, binarySimCLF, and bindata packages but none
of them works in R version 2.15.1.
Do you know any package to generate correlated binary covariates and work
in R version 2.15.1, or how to generate it?
Thanks,
[[alternative HTML version deleted]]
2007 Sep 17
1
Create correlated data with skew
Hi all,
I understand that it is simple to create data with a specific
correlation (say, .5) using mvrnorm from the MASS library:
> library(MASS)
> set.seed(1)
>
> a=mvrnorm(
+ n=10
+ ,mu=rep(0,2)
+ ,Sigma=matrix(c(1,.5,.5,1),2,2)
+ ,empirical=T
+ )
> a
[,1] [,2]
[1,] -1.0008380 -1.233467875
[2,] -0.1588633 -0.003410001
[3,] 1.2054727 -0.620558768
2003 May 09
1
generate correlated dataset
Hi,I want to generate a dataset, which have more than one clusters (say 2) and the elements in each cluster have high correlation (say 0.85) andelements among different clusters have low (say 0.1) or zero correlation.The correlation structure of final dataset should have a block-diagonal structure, that likes 0.85 0.85 .. 0.85 0 0 0 0 ...0 0 0...0 0 0
2011 Aug 11
5
generate two sets of random numbers that are correlated
Dear R users
I'd like to generate two sets of random numbers with a fixed correlation
coefficient, say .4, using R.
Any suggestion will be greatly appreciated.
Regards,
Kathryn Lord
--
View this message in context: http://r.789695.n4.nabble.com/generate-two-sets-of-random-numbers-that-are-correlated-tp3735695p3735695.html
Sent from the R help mailing list archive at Nabble.com.
2007 Feb 13
1
simulating from Langevin distributions
Dear all,
I have been looking for a while for ways to simulate from Langevin distributions and I thought I would ask here. I am ok with finding an algorithmic reference, though of course, a R package would be stupendous!
Btw, just to clarify, the Langevin distribution with (mu, K), where mu is a vector and K>0 the concentration parameter is defined to be:
f(x) = exp(K*mu'x) / const where
2009 Feb 12
3
get top 50 correlated item from a correlation matrix for each item
Hi,
I have a correlation matrix of about 3000 items, i.e., a 3000*3000
matrix. For each of the 3000 items, I want to get the top 50 items that
have the highest correlation with it (excluding itself) and generate a
data frame with 3 columns like ("ID", "ID2", "cor"), where ID is those
3000 items each repeat 50 times, and ID2 is the top 50 correlated items
with ID,
2006 Oct 12
2
Problem loading SpareM package
Hi,
I have just installed R 2.4.0 and when I try to load SpareseM, I get the following error message
library(SparseM)
Package SparseM (0.71) loaded. To cite, see citation("SparseM")
Error in loadNamespace(package, c(which.lib.loc, lib.loc), keep.source = keep.source) :
in 'SparseM' methods specified for export, but none defined: as.matrix.csr, as.matrix.csc,
2010 Jan 21
1
correlation significance testing with multiple factor levels
[Apologies in advance if this is too "statistics" and not enough "R".]
I've got an experiment with two sets of treatments. Each subject either received
all treatments from set A or all treatments from set B.
I can compute the N pairwise correlations for all treatments in either set using
cor(). If I take the mean of these N pairwise correlations, I see that the
effects
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
2008 May 09
1
Multivariate simulation
Dear everyone, I am having problem simulating multivariate data. Though I was able to simulate the data, but finding the variance-covariance matrix of simulated data did not give exact covariance matrix used in simulating the data. Unlike some other packages, like stata, using command "corr2data" will simulate data having the covariance matrix exactly with the specified covariance
2010 Jun 17
1
simulating data from a multivariate dist
Sir,
I am working on fitting distribution on multivariate financial data and then
simulate observations from that fitted distribution. I use stepAIC.ghyp()
function of 'ghyp' library which select the best fitted distribution from
generalized hyperbolic distribution class on the given dataset.
data(indices)
# Multivariate case:
aic.mv <- stepAIC.ghyp(indices, dist =
2007 Mar 16
1
ideas to speed up code: converting a matrix of integers to a matrix of normally distributed values
Hi all,
[this is a bit hard to describe, so if my initial description is
confusing, please try running my code below]
#WHAT I'M TRYING TO DO
I'd appreciate any help in trying to speed up some code. I've written
a script that converts a matrix of integers (usually between 1-10,000
- these represent allele names) into two new matrices of normally
distributed values (representing