I have 2 independent data sets, and I know the following about each of them: mean, SD, and sample size. I calculated the t-statistic just fine
I know that the degrees of freedom is n1+n2-2, now I just need to calculate the p-value. I tried just pnorm(t) but that didn't seem like it was correct. I only know the mean, SD, and sample size. I don't know the actual values of each observation; that's why I didn't use the t.test function.
Code:
my.t.test<-function(mu1, mu2, sd1, sd2, n1,n2){
t=(mu1-mu2)/sqrt((sd1)^2/n1+(sd2)^2/n2)
return(t)
}
I know that the degrees of freedom is n1+n2-2, now I just need to calculate the p-value. I tried just pnorm(t) but that didn't seem like it was correct. I only know the mean, SD, and sample size. I don't know the actual values of each observation; that's why I didn't use the t.test function.