[R] Help transfrom R to C

2010-04-05 Thread pinusan
Dear R users, I would like to transform the following "for loop" from R-code to C-code because it takes really long time to have inc.freqy table. Unfortunately, I do not have experience to write C code. Plese, give me some example or advise to transfrom the R to C code. I have attached the code

[R] How can I save the result for goodness of fit test

2010-03-16 Thread pinusan
Dear All, I run the goodness of fit test using goodfit() in vcd package. The result is as follow: Goodness-of-fit test for poisson distribution X^2 df P(> X^2) Pearson 1.053348 2 0.5905661 Warning message: In summary.goodfit(gf) : Chi-squared approximation may be incorrec

[R] Goodness of fit test for count data

2010-02-22 Thread pinusan
Dear all, I am trying to test goodness of fit. I assume that a data follow Poisson or Negative binomial distribution. I can test the goodness of fit in case of no truncated data. However, I could not find any good function or packages when a data is truncated. For example, a frequency table

[R] Solve equation using R

2010-02-17 Thread pinusan
Hello! I want to use R to calculate the variable x which is in some eqation, give an example: 2.2=x/(1-exp(-x)), how to solve equation to get the exact x in R? Thank you. Have a nice day. -- View this message in context: http://n4.nabble.com/Solve-equation-using-R-tp1559576p1559576.html

[R] Chisq test for truncated count data and estiamte the expectation value

2010-02-17 Thread pinusan
Dear all, I have some questions for count data. First, I want to calculate the expectation value and variance from truncated data when I assume that the truncated data follow Poisson or negative binomial distribution. For example, N freq 1 30 2 35 3 26 4 8 5