[R] How to combine two loops?

2013-01-12 Thread Agnes Ayang
Hello R-helpers, I want to ask your opinion since I am not so sure how to do it. This is regarding one part of my paper project and my situation is: Stage I I have 2 groups and for each group I need to compute the following steps; i) Generate 3 random numbers from normal distribution and squar

[R] Have problem to do loop to generate transformed chi-squared variates

2013-01-07 Thread Agnes Ayang
Hello R-helpers, I need to generate standard variates normal to 'create' chi-squared variates. To make you more understand, (1)   a<-rnorm(3,0,1) *after do (1), I need to squared and summed the three values. My problem is, how am I going to continue the programming if I had to repeat the proce

[R] Sampling data without having infinite numbers after diong a transformation

2012-12-25 Thread Agnes Ayang
Hello R-helpers.. I want to ask about how I can sample data sets without having the infinite numbers coming out. For example, set.seed(1234) a<-rnorm(15,0,1) b<-rnorm(15,0,1) c<-rnorm(15,0,1) d<-rnorm(15,0,36) After come out with the sample, I need to do a transformation (by Hoaglin, 1985) f

[R] seeking a help on if function

2012-12-17 Thread Agnes Ayang
Hello r helpers! Below is the whole coding for my programme. Before proceed more further, let me explain for you. First of all, I need to compute trimmed mean. Till that step is ok. Then I need to compute ssdw which is sum of square deviation. If I do equal trimming at both tail of distribution