Skip to content
Prev 61192 / 398498 Next

Doubts about chi-square distribution

Dear list,

For educational purposes I have been working with the script below.

I have a observation:

   line 31

   #CScal[i] = (amo^2)  # IT IS WRONG, I KNOW, BUT IT MAKE R TO CRASHES!

   I'm thinking this is a possible bug in the R!


And I have a couple of doubts:

1) line 51

    #curve(dchisq(x, n-1), add = T, col = 'red'

    I think that it is correct, but the function no match with the observed 
distribution.

    curve(dchisq(x, n), add = T, col = 'red') matches, so, what is wrong?

2) Plot

    I would like to distance the Ylabel from the left limit of the screen, is it 
possible?

Many thanks,