Displaying 20 results from an estimated 80 matches similar to: "Simulate binary correlated data"
2004 Dec 21
3
R code for var-cov matrix given variances and correlations
Dear list members,
Where can I find code for computing the p*p variance-covariance
matrix given a vector of p variances (ordered varA, varB, ...,
varp) and a vector of all possible correlations (ordered corAB,
corAC, ..., corp-1,p)?
I know that the covariance between 2 variables is equal to the
product of their correlation and their standard deviations:
corAB * varA^.5 * varB^.5
and so:
2009 Sep 08
7
Data separated by spaces, getting data into R using field lengths
I have a text file similar to this (separated by spaces):
x <- "DF12 This is an example 1 This
DF12 This is an 1232 This is
DF14 This is 12334 This is an
DF15 This 23 This is an example
"
and I know the field lengths of each variable (there is 5 variables in
this data set), which are:
varlength <- c(2, 2, 18, 5, 18)
How can I import this kind of data into R, using the varlength
2011 Feb 20
8
Generating uniformly distributed correlated data.
I wish to generate a vector of uniformly distributed data with a
defined correlation to another vector
The only function I have been able to find doing something similar is
corgen from the library ecodist.
The following code generates data with the desired correlation to the
vector x but the resulting vector y is normal and not uniform
distributed
library(ecodist)
x <- runif(10^5)
y
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]]
2012 Sep 27
2
Generating an autocorrelated binary variable
Hi R-fellows,
I am trying to simulate a multivariate correlated sample via the Gaussian copula method. One variable is a binary variable, that should be autocorrelated. The autocorrelation should be rho = 0.2. Furthermore, the overall probability to get either outcome of the binary variable should be 0.5.
Below you can see the R code (I use for simplicity a diagonal matrix in rmvnorm even if it
2007 Oct 17
1
correlated data
Hi!!
I am trying to generate data with specific correlation using corgen method from the ecodist package. It does not seem to generate the data properly. I am listing the code below. Secondly, when I put the code given below all in one file and source it, it is unable to complete the task. But when I execute it one at a time it is able to complete it. Can someone point out any mistake that I may
2012 Nov 29
2
[LLVMdev] problem trying to write an LLVM register-allocation pass
I have a new problem: Register RBP is used in a function foo. (I am not
allocating RBP to any virtual register, the instances of RBP in function
foo are in the machine code when my register allocator starts.)
Function foo calls function bar. Register RBP is not saved across the
call, though it is live after the call. Function bar includes a virtual
register. The code that I'm using to
2012 Mar 15
6
Generation of correlated variables
Hi everyone.
Based on a dependent variable (y), I'm trying to generate some independent
variables with a specified correlation. For this there's no problems.
However, I would like that have all my "regressors" to be orthogonal (i.e.
no correlation among them.
For example,
y = x1 + x2 + x3 where the correlation between y x1 = 0.7, x2 = 0.4 and x3 =
0.8. However, x1, x2 and x3
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
2008 May 28
15
Help with output
I am having problems trying to get the output to work in an
application I have. Here is the example
THIS GIVES ME THE CORRECT VALUES
<!-- ######## Flooring ######### -->
<% if(params[:flooring]) %>
<tr><td colspan="4"><h2>Flooring</h2></td></tr>
<% for company in @companies
2011 Mar 19
3
Generating repeated measures data
How would one generate data to be used in a simulation of a repeated measures ANOVA given a known (1) within-person correlation with known (2) mean and SD of data obtained at each of three times of observation?
Thanks,
John
John Sorkin
Chief Biostatistics and Informatics
Univ. of Maryland School of Medicine
Division of Gerontology and Geriatric Medicine
JSorkin at grecc.umaryland.edu
2009 Nov 25
3
Random data
Hi,
how can I produce random data which lies around a straight line with angle
45 degree.
Similar to this image: http://zoonek2.free.fr/UNIX/48_R/g134.png
Cheers
--
View this message in context: http://old.nabble.com/Random-data-tp26513822p26513822.html
Sent from the R help mailing list archive at Nabble.com.
2010 Sep 14
1
predict(backSpline(x)): losing my marbles?
I'm sure I'm doing something completely boneheaded here, but I've
used this idiom
(constructing an interpolation spline and using prediction from a
backSpline to find
an approximation profile confidence interval) many times before and
haven't hit this
particular problem:
r2 <- c(1.04409027570601, 1.09953936543359, 1.15498845516117,
1.21043754488875,
2011 Dec 17
0
Registry entry to change MIDI mapper changed?
I'm trying to get the MIDI music for the 1996 SegaSoft game Lose Your Marbles (http://appdb.winehq.org/objectManager.php?sClass=version&iId=9196) working. The game itself remains Platinum under 1.3.34-- it runs great, without any overrides, and the sound effects work fine too... it's just the MIDI music that does not play, or rather, is not heard.
I went to the Wiki and performed all
2006 Mar 17
3
Binning question (binning rows of a data.frame according to a variable)
Hi,
I have tuples of data in rows of a data.frame, each column is a variable
for the 'items' (one per row).
One of the variables is the 'size' of the item (row).
I would like to cut my data.frame into groups such that each group has
the same *total size*. So, assuming that we order by size, some groups
should have several small items while other groups have a few large
2011 May 12
1
extract integers from string
I have a vector with a long list of sentences that contain integers. I
would like to extract the integers in a manner such that they are
separate and manipulatable. for example:
x[i] <- "sally has 20 dollars in her pocket and 3 marbles"
x[i+1] <- "30 days ago john had a 400k house"
all sentences are different and contain a mixture of both integers and
characters.
i
2007 May 12
1
mtrace() fails
I find the R debug package very useful. I've installed and used it on
several of the machines I use, without problems, but on one machine I
get the following error:
Loading required package: mvbutils
Loading required package: utils
MVBUTILS: no "tasks" vector found in ROOT
Loading required package: tcltk
Loading Tcl/Tk interface ... done
[Previously saved
2005 Jun 28
3
Help with stripplot
For the following code is there a way to make the jitter all line up horizontally, instead of them being just randomly spread around a value. So for ex if there are multiple values at 63 for genotype wt then all the values should be plotted on the same y value of 63 but spaced apart by a certain factor or noise..
library(lattice);
dataFrame <- as.data.frame(t(structure(c(
64,'wt',
2005 Jul 05
0
plot legend outside the grid
Thanks Bert for all the help. I got the legend figured out Friday but left early becoz of long weekend so didn't get a chance to reply.. I modified the plot margins a little bit and Here's what I finally had...
par(mar=c(c(10, 6, 6, 10) + 0.1));
par(xpd=FALSE);
with (dataFrame, stripchart(marbles_buried ~ genotype, method="jitter", vertical=TRUE, col = c('blue',
2005 Jun 30
1
FW: plot legend outside the grid
-----Original Message-----
From: Ghosh, Sandeep
Sent: Thursday, June 30, 2005 5:43 PM
To: 'Berton Gunter'
Subject: plot legend outside the grid
Thanks for the pointers... I managed to get everything to look and feel the way I want except for the legend to plot outside the grid... Thanks for the note on the par, but I'm not able to it to plot outside the plot grid..
dataFrame <-