test.spear(.471, .2, 100)
# Should return:
# Estimate z p
# 0.471 3.009628 0.00261568
test.spear(.342, 0, 100)
# Should return:
# Estimate t df p
# 0.342 3.602881 98 0.0004965008
Run the code above in your browser using DataLab