Re: [R] Bug : Autocorrelation in sample drawn from stats::rnorm (hmh)

2018-10-05 Thread Annaert Jan
On 05/10/2018, 09:45, "R-help on behalf of hmh" wrote: Hi, Thanks William for this fast answer, and sorry for sending the 1st mail to r-help instead to r-devel. I noticed that bug while I was simulating many small random walks using c(0,cumsum(rnorm(10))). The

Re: [R] Bug : Autocorrelation in sample drawn from stats::rnorm

2018-10-04 Thread Annaert Jan
Did you take into account that the sample serial correlation coefficient has a bias of approximately -1/T (with T the sample size)? Its variance is approximately 1/T. Jan Annaert -Original Message- From: R-help On Behalf Of hmh Sent: donderdag 4 oktober 2018 12:09 To: R Subject: [R]

Re: [R] F-test where the coefficients in the H_0 is nonzero

2018-08-02 Thread Annaert Jan
You can easily test linear restrictions using the function linearHypothesis() from the car package. There are several ways to set up the null hypothesis, but a straightforward one here is: > library(car) > x <- rnorm(10) > y <- x+rnorm(10) > linearHypothesis(lm(y~x), c("(Intercept)=0", "x=1"))