Linked Questions
22 questions linked to/from How to simulate data that satisfy specific constraints such as having specific mean and standard deviation?
3
votes
1
answer
992
views
From unevenly spaced values, a normal distribution that sums to the mean
I have input data that is $N$ items and each has several properties, one of which is called, say, $P$. Their values of $P$ are unevenly spaced between 0 and 1, and may even repeat between items. For ...
1
vote
0
answers
2k
views
How to simulate data in R given mean, median, and range?
I would like to simulate n numbers (all within the range between a and b, n being an even number) using R, and the mean (u) and median (m) is given.
If I use runif then the standard deviation is ...
1
vote
2
answers
201
views
How to generate normal variates subject to mixed constraints?
I want to randomly generate 1000 normal variates (using rnorm, e.g.) that have mean 100. 25% of the 1000 numbers should be over 110.
How can I do this in ...
1
vote
2
answers
660
views
how to generate random data based on simple statistical meassures
0
I currently have a test data set that has 500k data points. I have an algorithm that process that data and returns some information. In order to establish the statistical significance of the ...
3
votes
1
answer
409
views
Simulating population-level logistic regression model with pre-specified prevalence
I'm interested in simulating the following prospective, population-based model for binary outcome $Y_i$, and independent subjects $i=1,\dots,N$:
$$
\Pr(Y_i=1\mid X_i,G_i)=\frac{1}{1+\exp(-(\alpha_0 + ...
4
votes
1
answer
212
views
Generate nonnegative variates with mean 1 and specified variance-covariance
Problem
In several applications in surveys, it would be helpful to be able to generate a set of $R$ $n$-dimensional variates with the following properties:
Has mean vector $1$
Has a specified ...
1
vote
1
answer
107
views
How can I shift the average probability keeping constraint (0.0:1.0)?
I have a large datasets of values that range from 0 to n. I am interpreting the values as probabilities for a later pseudo-random selection process. To make the values serve as probabilities, I ...