Re: [R] Simulating data with nested random effects

2018-10-17 Thread Bert Gunter
This would almost certainly fit better on the r-sig-mixed-models list,rather than here. You are more likely to get authoritative responses about this specialized statistical topic there. Also -- these are **plain text** mailing lists. Please do not post in html. Cheers, Bert Bert Gunter "The t

[R] Simulating data with nested random effects

2018-10-17 Thread Peter Wijeratne
Hello, I would like to simulate nested data, where my mixed effects model fitted to real data has the form: y ~ time + (1 | site/subject) I then take the hyper-parameters from this model to simulate fake data, using this function: create_fake <- function(J,K,L,HP,t){

Re: [R] Simulating data

2015-06-29 Thread PIKAL Petr
d Sent: Monday, June 29, 2015 9:21 AM To: PIKAL Petr Cc: r-help Subject: Re: [R] Simulating data ok. ill just paste the data here ... hope it helps y x 5721 20175 4285 1 4327 59426 4964 75536 7899 79432 11140 125735 11843 89411 18146 124805 24712 110859 31993 178038

Re: [R] Simulating data

2015-06-29 Thread deva d
t; > Sent: Monday, June 29, 2015 8:36 AM > > To: r-help > > Subject: [R] Simulating data > > > > i wish to simulate data to generate twice the sample size for testing a > > model. > > > > the two fields to be simulated are y and x, in the attached file.

Re: [R] Simulating data

2015-06-29 Thread PIKAL Petr
Hi Attachments are usually discarded. maybe ?sample Petr > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of deva d > Sent: Monday, June 29, 2015 8:36 AM > To: r-help > Subject: [R] Simulating data > > i wish to simulate data

[R] Simulating data

2015-06-28 Thread deva d
i wish to simulate data to generate twice the sample size for testing a model. the two fields to be simulated are y and x, in the attached file. as you will see, these represent data of several companies, of different sizes, for a 11 year period. the distribution is not really fitting into any kn

Re: [R] Simulating data from a nested design

2015-06-07 Thread Greg Snow
The examples on the help page for the function "simfun" in the TeachingDemos package have some examples of simulating data from nested designs with some terms fixed and some random. I don't think any of the examples match your conditions exactly, but could be modified to do so (changing a random e

Re: [R] Simulating data from a nested design

2015-06-06 Thread Jim Silverton
Hi, I am trying to 'create' a nested design with A, B nested in A and C nested in B. C is random and the others are fixed. Does anyone have any idea how to do this? I would also like to try the other nested designs with all random and all effects fixed. -- Thanks, Jim. [[alternative HTM

Re: [R] Simulating data

2014-04-04 Thread Frede Aakmann Tøgersen
.com/legal/notice If you have received this e-mail in error please contact the sender. > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Mª Teresa Martinez Soriano > Sent: 4. april 2014 10:49 > To: r-help@r-proj

[R] Simulating data

2014-04-04 Thread Mª Teresa Martinez Soriano
Hi to everyone To simulate data I only know this command: rnorm(n , mean, sd)   It exists another way to specify Median and range as well? The point is that I have  this information about the variable: Median: 4.3 Mean: 4.2 SD: 1.8 Range: 0-8 and I need a boxplot, but I don't have the origin

[R] Simulating data with conditions

2011-05-24 Thread AC Del Re
Hi, I am wanting to simulate data where a percentage of the data has multiple duplicated id variables (with unique values of another factor variable for the dupicated id variables). Im having trouble figuring out an efficent way to do so. For example, consider this mock output [Note: Although the

[R] Simulating data and imputation

2010-12-29 Thread Sarah
Hi, I wrote a script in order to simulate data, which I will use for evaluating missing data and imputation. However, I'm having trouble with the last part of my script, in which a dataframe is constructed without missing values. This is my script: y1 <- rnorm(10,0,3) y2 <- rnorm(10,3,3) y3 <-

Re: [R] Simulating data, loop

2010-10-29 Thread Ivan Calandra
Hi Sarah, There is one thing you need to think about: how do you choose which values should not be removed if you have more than 20 and which should be if you have less than 20. In my code, I've just done it with sample(), which might not be what you need. Here is what I have: if (length(whi

[R] Simulating data, loop

2010-10-29 Thread Sarah
Hello, I would like to run a script in which a loop is included. Since I'm new to R, I cannot manage the following problem. I really hope someone could help me out. Data in the variable Y should be removed from the simulated data set with probability 0.50 if the variable X has a value below zero

Re: [R] simulating data from a multivariate dist

2010-06-17 Thread Joris Meys
Dirty hack, but it's working. library(MASS) mu <- aic.mv$best.mo...@expected.value sigma <- aic.mv$best.mo...@variance mvrnorm(100,mu,sigma) If you'd like to follow the rules, look for the functions to extract the expected value and the variance of the best model out of the stepAIC.ghyp object.

[R] simulating data from a multivariate dist

2010-06-17 Thread suman dhara
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

Re: [R] Simulating data (stupid question)

2009-08-24 Thread Liviu Andronic
Hello Your attachement didn't seem to get through. You can simulate data using rnorm() or any of the r*() functions [1]. You can also use it to add noise to a custom function that you use to generate your specific data. Liviu [1] http://www.statmethods.net/management/functions.html On 8/25/09,

Re: [R] Simulating data (stupid question)

2009-08-24 Thread KABELI MEFANE
Dear All   I know that you do not have to help me but please do, i am new to R as a CPI compiler, i just need to do a sample to see which sampling method best works in different situations, therefore since this is for practice purposes nobody will finance a real project thats why i need you to h