Re: [R] simulation data in SEM

2014-09-15 Thread PO SU
PLZ mke sure the package installed which contains mvrnorm function. -- PO SU mail: desolato...@163.com Majored in Statistics from SJTU At 2014-09-14 09:56:34, thanoon younis thanoon.youni...@gmail.com wrote: Dear R members I want to simulate data depending on SEM and when i applied the

[R] simulation data in SEM

2014-09-14 Thread thanoon younis
Dear R members I want to simulate data depending on SEM and when i applied the code below i found some errors and i still cannot run it. many thanks in advance Thanoon #Do simulation for 100 replications N-1000; P-10 phi-matrix(data=c(1.0,0.3,0.3,1.0),ncol=2) #The covariance matrix of xi

Re: [R] simulation data in SEM

2014-09-14 Thread Don McKenzie
What errors? What is your output? What output did you expect? On Sep 14, 2014, at 6:56 AM, thanoon younis thanoon.youni...@gmail.com wrote: Dear R members I want to simulate data depending on SEM and when i applied the code below i found some errors and i still cannot run it. many thanks

Re: [R] simulation data in SEM

2014-09-14 Thread Don McKenzie
cc�ing to list, as requested in the posting guide, so that others may be able to help you. On Sep 14, 2014, at 8:45 AM, thanoon younis thanoon.youni...@gmail.com wrote: Thank you very much for your reply the output is #Do simulation for 100 replications N-1000; P-10

Re: [R] simulation data in SEM

2014-09-14 Thread David Winsemius
On Sep 14, 2014, at 8:48 AM, Don McKenzie wrote: cc’ing to list, as requested in the posting guide, so that others may be able to help you. On Sep 14, 2014, at 8:45 AM, thanoon younis thanoon.youni...@gmail.com wrote: Thank you very much for your reply the output is #Do simulation

Re: [R] simulation data in SEM

2014-09-14 Thread David Winsemius
Adding back the list address: On Sep 14, 2014, at 9:53 AM, thanoon younis wrote: thank you for your help but i still have error after putting semicolon Error: unexpected symbol in: Ro-matrix(data=c(7.0,2.1,2.1,7.0), ncol=2) yo-matrix(data=NA,nrow=N,ncol=P) p The error message shows no

[R] simulation data with mixed variables

2014-09-01 Thread thanoon younis
dear all members i am trying to simulate data with mixed ordered categorical and dichotomous variables with 200 observation and 10 var. 5 ordered categorical and 5 dichotomous and i want to put a high correlation between variables so i must find correlation between dichotomous and the

[R] simulation data with dichotomous variables

2014-08-23 Thread thanoon younis
dear all members i have a problem with the code below, my problem in this code i want to put a high correlation between variables in group R1 and also put a high correlation between variables in group R2. after checking the correlation between variables in R1 also between variables in R2 i didn't

Re: [R] simulation data with dichotomous varuables

2014-08-10 Thread William Revelle
Dear Thanoon, You might look at the various item simulation functions in the psych package. In particular, for your problem: R1 - sim.irt(10,1000,a=3,low = -2, high=2) R2 - sim.irt(10,1000,a=3,low = -2, high=2) R12 - data.frame(R1$items,R2$items) #this gives you 20 items, grouped with high

[R] simulation data with dichotomous varuables

2014-08-04 Thread thanoon younis
Dear R-users i need your help to solve my problem in the code below, i want to simulate two different samples R1 and R2 and each sample has 10 variables and 1000 observations so i want to simulate a data with high correlation between var. in R1 and also in R2 and no correlation between R1 and R2

Re: [R] simulation data

2014-04-10 Thread Rui Barradas
Hello, At an R prompt type ?rbinom ?replicate Hope this helps, Rui Barradas Em 10-04-2014 02:28, thanoon younis escreveu: hi i want to simulate multivariate dichotomous data matrix with categories (0,1) and n=1000 and p=10. thanks alot in advance [[alternative HTML version

Re: [R] simulation data

2014-04-10 Thread Charles Determan Jr
Thanoon, My reply to your previous post should be more than enough for you to accomplish your goal. Please look over that script again: ords - seq(4) p - 10 N - 1000 percent_change - 0.9 R - as.data.frame(replicate(p, sample(ords, N, replace = T))) or alternatively as Mr. Barradas suggests

[R] simulation data

2014-04-09 Thread thanoon younis
hi i want to simulate multivariate dichotomous data matrix with categories (0,1) and n=1000 and p=10. thanks alot in advance [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] simulation data

2014-04-09 Thread Rolf Turner
On 10/04/14 09:28, thanoon younis wrote: hi i want to simulate multivariate dichotomous data matrix with categories (0,1) and n=1000 and p=10. Nobody's stopping you! :-) cheers, Rolf Turner __ R-help@r-project.org mailing list

Re: [R] simulation data

2014-04-05 Thread Charles Determan Jr
Thanoon, Firstly, please remember to reply to the R help list as well so that other may benefit from your questions as well. Regarding your second request, I have written the following as a very naive way of inducing correlations. Hopefully this makes it perfectly clear what you change for

[R] simulation data

2014-04-04 Thread thanoon younis
dear sir i want to simulate multivariate ordinal data matrix with categories (1,4) and n=1000 and p=10. thanks alot thanoon [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] simulation data

2014-04-04 Thread Charles Determan Jr
Hi Thanoon, How about this? # replicate p=10 times random sampling n=1000 from a vector containing your ordinal categories (1,2,3,4) R - replicate(10, sample(as.vector(seq(4)), 1000, replace = T)) Cheers, Charles On Fri, Apr 4, 2014 at 7:10 AM, thanoon younis thanoon.youni...@gmail.comwrote: