The sign test is used for hypothesis testing by concerning the value of the median for one population, and comparing the median differences for two variables for two dependent samples.
Assumptions of the sign test.
- Random sampling
- Independent measurements
- Data should be measurement, counts or scores.
Sign test for one population in Excel
Step 1: Put your two example data sets into a table to prepare for the test, set the null and alternative hypothesis
Step 2: Prepare a sign column calculated the sign values
Step 3: calculated the number of positive signs and number of negative signs
Step 4: Calculate the number of positive signs and number of negative signs
Step 5: Calculate the smaller sign value
Step 6: Then calculated the P-value (probability value)
Step 7: According to the P-value, check whether the null hypothesis is rejected or not.
Sign test for two paired samples in Excel
Step 1: Calculated the sign value
Step 2: Calculate the abs value
Step 3: Calculate the sign rank value
Step 4: Calculate the positive and negative sum values
Step 5: Calculate the test-statistics (calculated value) – lowest sum value is taken as the test statistics
Step 6: find the critical value from the critical value table for given significant value
Step 7: If critical value is greater than the calculated value null hypothesis will rejected.
Sign Test in R
#FOR ONE SAMPLE SIGN TEST
install.packages("BSDA")
library(BSDA)
SIGN.test(data, md, conf.level, alternative)
#FOR TWO PAIRED SAMPLES
data = read.csv(‘‘data_file.csv’’, header = TRUE)
SIGN.test (data$A, data$B, alternative, conf.level)