# Tagged Questions

52 views

### Simulating data to fit a mediation model

I am interested in finding a procedure to simulate data that are consistent with a specified mediation model. According to the general linear structural equation model framework for testing mediation ...
66 views

### Is it correct that no statistical simulation is done using $2^{256}$ (or more) outputs from a MWC prng?

In a conversation about Marsaglia's Multiply-With-Carry pseudo-random number generator and its potential use in generating random data for statistical purposes, someone said: There is no ...
117 views

### How to simulate an unreplicated factorial design?

I am dealing with a unreplicated factorial design. I have some illustrative examples but I need to simulate some unreplicated factorial designs. I do not how and what to use. Can $R$ handle this? For ...
82 views

### Generating random samples from a given distribution

What are the different methods by which we can generate random samples from the existing distribution which are computationally efficient? One of the common methods given in statistics text is by ...
33 views

### Creating statistically similar sequences

I have to run a test on a program, with some statistical tools to make sure its results are statistically acceptable. This program will take sequences of data information (a vector of integers or ...
23 views

### How to generate a non-normal correlated bivariate distribution [duplicate]

I am trying to work out how to generate numbers from a bivariate distribution (any one but the normal distribution) while still being able to control the correlation between the two variables (let's ...
217 views

### When simulating a bivariate normal distribution, why is $\rho$ chosen instead of estimated from the data?

In a video lecture, MrProf shows the 3d-plot of a bivariate normal distribution $\mu_{x_1} = \mu_{x_2} = \sigma_1 = \sigma_2 = 1$ and chooses $\rho = 0.5$ . If stick to Mathworld, $\rho$ simply is ...
2k views

### How can I generate data with a prespecified correlation matrix?

I’m trying to generate correlated random sequence with mean = $0$, variance = $1$, correlation coefficient = $0.8$. In the code below, I use s1 & ...
4k views

### How to simulate data that satisfy specific constraints such as having specific mean and standard deviation?

This question is motivated by my question on meta-analysis. But I imagine that it would also be useful in teaching contexts where you want to create a dataset that exactly mirrors an existing ...
I recall having been told that to generated $p$ variate Marshall Olkin distribution, one proceeds as follow: For $p=2$, generate $X_1,X_2,X_3\sim exp(\lambda)$, then $(Y_1,Y_2)\sim MMO$ where ...
How can I generate binary time series such that: Average probability of observing 1 is specified (say 5%); Conditional probability of observing 1 at time $t$ given the value at $t-1$ ( say 30% if ...