Determine a p-value for the strength of similarity between two bullets based on scores for each land-to-land comparison.
Arguments
- land1
vector with land ids of the LEAs in bullet 1
- land2
vector with land ids of the LEAs in bullet 2
- score
real-valued vector consisting of land-to-land comparisons. Higher values are assumed to describe higher similarity.
- sigma_0
real valued, standard deviation of the different source distribution. If
NA(default), the standard deviation of the scores corresponding to non-matches (after selecting the highest phase) is taken. Real-values are interpreted as fixed standard deviation. The user can provide their own function of the formfunction (data), wheredatais a data frame withland1, land2, score,andphase. Thephasevector consists of integer values 1, ...,k, wherekis the maximum of the number of unique lands in land1 and land2. The values are ordered such that the highest valuekof phase corresponds to the elements in score with the highest average score.- alpha
significance level for a rejection, acceptable Type 1 error.
Value
phase.test object - special case of an htest (hypothesis test). Additionally includes the data used.
Examples
score <- rnorm(36)
phase_test(land1 = rep(1:6, 6), land2 = rep(1:6, each = 6), score = score)
#>
#> Phase Test
#>
#> data:
#> T = 0.71524, sigma_0 = 0.73631, df = 6, p-value = 0.7481
#> alternative hypothesis: true difference in means between group SS and group DS is greater than 0 (indicating same-source)
#> sample estimates:
#> SS (mean) DS (mean)
#> 0.4073304 -0.3079061
#>