The Hypothesis Operator

The hypothesis operator requires a summary function as its left operand and a relational function as its right operand.   The left argument is a sample vector, and the right argument is a hypothesized value or another sample vector.

The left argument is the confidence level; it is optional--the default is a 95%.  The left operand is a summary function, typically: mean, proportion, variance or sdev.   The right operand can be either a numeric vector, a 2-column matrix representing a frequency distribution, or a namespace containing count, mean and variance.

The syntax of the hypothesis operator is:

        [ConfLevel] report SampleVector summaryFunction hypothesis relationalFunction Value|SampleVector2

Some examples follow:

A sample of 15 heights of college students was taken and is listed below:

   Height←69 69 63 63 66 67 73 67 70 72 71 63 68 63 66

Test whether the mean height is 68 inches:

   report Height mean hypothesis = 68
 

────────────────────────────────────────────────
 _                                              
 X =67.33333                                    
 s =3.37357                                     
 n =15                                          
 Standard Error: 0.87105                        
                                                
 Hypothesis Test                                
                                                
  H₀: µ=68 (Claim)         H₁: µ≠68    
  µ
 ┌────────────────────────┬───────────────────┐ 
 │Test Statistic:         │P-Value:           │ 
 │t=0.7653587777          │p=0.45677          │ 
 ├────────────────────────┼───────────────────┤ 
 │Critical Value:         │Significance Level:│ 
 │t(α/2;df=14)=2.144786686│α=0.05             │ 
 └────────────────────────┴───────────────────┘ 
  Conclusion: Fail to reject H₀                 
────────────────────────────────────────────────

Test at the 10% significance level whether the proportion of students taller than 70 inches is greater than 9%.

   0.1 report (Height > 70) proportion hypothesis proportion > .09

 ────────────────────────────────────────

 ^                                      
 p =0.20000                             
 n =15                                  
 Standard Error: 0.07389                
                                        
 Hypothesis Test                        
                                        
  H₀: p≤0.09           H₁: p>0.09 (Claim) 
 ┌────────────────┬───────────────────┐ 
 │Test Statistic: │P-Value:           │ 
 │Z=1.488662895   │p=0.06829          │ 
 ├────────────────┼───────────────────┤ 
 │Critical Value: │Significance Level:│ 
 │Z(α)=1.281551837│α=0.1              │ 
 └────────────────┴───────────────────┘ 
  Conclusion: Reject H₀                 
────────────────────────────────────────

Test at 1% confidence whether the standard deviation of heights is greater than 3 inches.

   0.01 report Height sdev hypothesis > 3 
 

───────────────────────────────────────────────
 s =3.37357                                    
 n =15                                         
                                               
 Hypothesis Test                               
                                               
  H₀: σ≤3                 H₁: σ>3 (Claim)      
 ┌───────────────────────┬───────────────────┐ 
 │Test Statistic:        │P-Value:           │ 
 │χ²=17.7037037          │p=0.22061          │ 
 ├───────────────────────┼───────────────────┤ 
 │Critical Value:        │Significance Level:│ 
 │χ²(α;df=14)=29.14123773│α=0.01             │ 
 └───────────────────────┴───────────────────┘ 
  Conclusion: Fail to reject H₀                
───────────────────────────────────────────────

Find an 80% confidence interval for the median.

   0.8 median confInt Height 
66 69

A sample of  85 home sales from a certain city was taken and the average price was $149,000 with a standard devation of $25,000.  Test the hypothesis that the average home price is less than $155,000.

   report (stats 85 149000 25000) mean hypothesis < 155000
 

─────────────────────────────────────────────
 _                                           
 X =149000                                   
 s =25000                                    
 n =85                                       
 Standard Error: 2711.63072                  
                                             
 Hypothesis Test                             
                                             
  H₀: µ≥155000           H₁: µ<155000 (Claim) 
 ┌─────────────────────┬───────────────────┐ 
 │Test Statistic:      │P-Value:           │ 
 │t=2.21269067         │p=0.01482          │ 
 ├─────────────────────┼───────────────────┤ 
 │Critical Value:      │Significance Level:│ 
 │t(α;df=84)=1.66319669│α=0.05             │ 
 └─────────────────────┴───────────────────┘ 
  Conclusion: Reject H₀                      
─────────────────────────────────────────────

A sample of 38 students were asked how many siblings each had.   2 were only children, 17 had one sibiling, 11 had two siblings, 7 and three and one had four. Test whether the average student has at least one brother or sister.        

   FD←0 1 2 3 4,[1.5]2 17 11 7 1
    0.10 report FD mean hypothesis ge 1

 

────────────────────────────────────────────
 _                                          
 X =1.68421                                 
 s =0.93304                                 
 n =5                                       
 Standard Error: 0.41727                    
                                            
 Hypothesis Test                            
                                            
  H₀: µ≥1 (Claim)        H₁: µ<1            
 ┌────────────────────┬───────────────────┐ 
 │Test Statistic:     │P-Value:           │ 
 │t=¯1.639746471      │p=0.91180          │ 
 ├────────────────────┼───────────────────┤ 
 │Critical Value:     │Significance Level:│ 
 │t(α;df=4)=1.53320625│α=0.1              │ 
 └────────────────────┴───────────────────┘ 
  Conclusion: Fail to reject H₀             
────────────────────────────────────────────