-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
z.test returning NA's #25
Comments
The function does not automatically remove NA values. I do not have your data but I suspect you have NA values in one or both of Dat1$ColumnA and Dat2$ColumnA. Try ` sd16 <- sd(Dat1$ColumnA, na.rm = T) z.test(x = na.omit(Dat1$ColumnA), sigma.x = sd16, y = na.omit(Dat2$ColumnA), sigma.y = sd17) |
Thanks for bringing this to my attention. I just updated the code to remove the NAs as I claimed in the documentation. Please use the development version 1.2.1 for the latest fix. I will update BSDA on CRAN in a month or so. Let me know if the code in 1.2.1 solves your issue. |
It worked perfectly! Thank you so much for your help! |
Issue closed |
Hello,
I am using the z.test function from the BSDA package in an attempt to analyze some data and I keep getting an output of "NA". There are no errors when I run the test, but all of my outputs ( z=, p-value =, etc) simply say NA. Below is the code I have written to run the analysis, hopefully you can provide some insight.
Dat1 <- Dat[Dat$Year == 1,]
Dat2 <- Dat[Dat$Year == 2,]
sd16 <- sd(Dat1$ColumnA, na.rm = T)
sd17 <- sd(Dat2$ColumnA, na.rm = T)
z.test(x = Dat1$ColumnA, sigma.x = sd16, y = Dat2$ColumnA, sigma.y = sd17)
The text was updated successfully, but these errors were encountered: