Degree of freedom in t.test ()

I used the t.test () function to calculate the t-test of the following:

t.test(iris$Petal.Width[iris$Species == "setosa"],
       iris$Petal.Width[iris$Species == "versicolor"])

      

There are 150 lines (100 for versicolor and 50 for setosa).

The dof here when I check the t-test output is 74.755. I wanted to know how this value is obtained as I wanted to t-test manually. I managed to get the t-statistic correctly, but I also want to get the p-value. For my p-value, I used df as 148 (n-2). And it doesn't get the same result as t.test ().

+3


source to share





All Articles