1
$\begingroup$

I am struggling to understand if I can make such a hypothesis or not and if so, which test is best to validate it.

I have a data with a size of 50 (quality of wine) I see that a sensory quality happening there (lets say a number is repeated few times). To make it more understandable, I have 50 signs , taste, color .... I see that taste is repeated few times in that 50 population. SO my hypothesis is if this number is by chance or just correct
so I want to test this hypothesis if I pick up the same size of the data for as many times as I want (100000) from a database with so many wine samples what is the chance to get to the number of taste that I got for my set of data .

Which test is suitable to check for this hypothesis ?

$\endgroup$
4
  • $\begingroup$ If the number in question is an integer and bounded than a $\chi^2$ test to test for number frequencies could be used. Alternatively you could use a uniform distribution goodness of fit test. $\endgroup$ Feb 15, 2019 at 9:03
  • $\begingroup$ @user2974951 can you show an example in R ? $\endgroup$
    – Learner
    Feb 15, 2019 at 15:02
  • $\begingroup$ You have two different questions as I see it, one asks whether the counts for quality in your sample are all roughly equally frequent, the other asks whether these proportions will be similar if you repeat this procedure many times. is this correct? $\endgroup$ Feb 19, 2019 at 8:36
  • $\begingroup$ @user2974951 Yes you are right $\endgroup$
    – Learner
    Feb 19, 2019 at 15:37

1 Answer 1

0
$\begingroup$

For the first question testing whether the counts for quality in your sample are all roughly equally frequent you can use a Chi-square test. The null hypothesis is independence between the categories.

For the second question testing whether these proportions will be similar if you repeat this procedure many times a permutation / bootstrap test can be used. You would bootstrap your sample many times, record the counts / frequencies, and then compare these with the values from your original sample.

Edit: here is an example in R using mtcars dataset. We will look at the gear column and treat it as a count.

> table(mtcars$gear)

 3  4  5 
15 12  5 

Chi-square test

> chisq.test(table(mtcars$gear))

    Chi-squared test for given probabilities

data:  table(mtcars$gear)
X-squared = 4.9375, df = 2, p-value = 0.08469

So we keep the null hypothesis. Now let's use bootstrapping on the X-squared statistic, repeating 1000 times.

> res=replicate(1000,{
>   tmp=sample(mtcars$gear,replace=T)
>   chisq.test(table(tmp))$statistic
> })

> summary(res)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
 0.0625  3.8125  6.4375  6.7245  8.6875 25.0000

Now we compare the original X-square statistic of the original sample with the resulting vector of X-square values obtained through bootstrapping.

> mean(res>=4.9375)
[1] 0.649

So based on the bootstrap our results are quite likely under the null hypothesis.

$\endgroup$
1
  • $\begingroup$ can you give a practical example in R for example? or Matlab or anything else $\endgroup$
    – Learner
    Feb 21, 2019 at 14:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.