-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ec1ee27
commit 35be6d6
Showing
32 changed files
with
979 additions
and
833 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# output from one way anova is as expected | ||
|
||
Code | ||
ifr_oneway_anova(mtcars, mpg, cyl) | ||
Output | ||
ANOVA | ||
-------------------------------------------------------------------- | ||
Sum of | ||
Squares DF Mean Square F Sig. | ||
-------------------------------------------------------------------- | ||
Between Groups 824.785 2 412.392 39.699 0 | ||
Within Groups 301.263 29 10.388 | ||
Total 1126.048 31 | ||
-------------------------------------------------------------------- | ||
Report | ||
---------------------------------------- | ||
Category N Mean Std. Dev. | ||
---------------------------------------- | ||
4 11 26.664 4.510 | ||
6 7 19.743 1.454 | ||
8 14 15.100 2.560 | ||
---------------------------------------- | ||
Number of obs = 32 R-squared = 0.7325 | ||
Root MSE = 3.2231 Adj R-squared = 0.714 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# output from ifr_binom_calc is as expected when k < exp_k | ||
|
||
Code | ||
ifr_binom_calc(32, 8) | ||
Output | ||
Binomial Test | ||
-------------------------------------- | ||
Group N Obs. Prop Exp. Prop | ||
-------------------------------------- | ||
0 24 0.75 0.500 | ||
1 8 0.25 0.500 | ||
-------------------------------------- | ||
Test Summary | ||
------------------------------------------ | ||
Tail Prob p-value | ||
------------------------------------------ | ||
Lower Pr(k <= 8) 0.0035 | ||
Upper Pr(k >= 8) 0.998949 | ||
------------------------------------------ | ||
|
||
# output from ifr_binom_calc is as expected when k > exp_k | ||
|
||
Code | ||
ifr_binom_calc(32, 20) | ||
Output | ||
Binomial Test | ||
-------------------------------------- | ||
Group N Obs. Prop Exp. Prop | ||
-------------------------------------- | ||
0 12 0.375 0.500 | ||
1 20 0.625 0.500 | ||
-------------------------------------- | ||
Test Summary | ||
-------------------------------------------- | ||
Tail Prob p-value | ||
-------------------------------------------- | ||
Lower Pr(k <= 20) 0.944908 | ||
Upper Pr(k >= 20) 0.107664 | ||
-------------------------------------------- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# ouput from ifr_chisq_assoc_test is as expected | ||
|
||
Code | ||
ifr_chisq_assoc_test(hsb, female, schtyp) | ||
Output | ||
Chi Square Statistics | ||
Statistics DF Value Prob | ||
---------------------------------------------------- | ||
Chi-Square 1 0.0470 0.8284 | ||
Likelihood Ratio Chi-Square 1 0.0471 0.8282 | ||
Continuity Adj. Chi-Square 1 0.0005 0.9822 | ||
Mantel-Haenszel Chi-Square 1 0.0468 0.8287 | ||
Phi Coefficient 0.0153 | ||
Contingency Coefficient 0.0153 | ||
Cramer's V 0.0153 | ||
---------------------------------------------------- | ||
|
||
# ouput from ifr_chisq_assoc_test 2 is as expected | ||
|
||
Code | ||
ifr_chisq_assoc_test(hsb, female, ses) | ||
Output | ||
Chi Square Statistics | ||
Statistics DF Value Prob | ||
---------------------------------------------------- | ||
Chi-Square 2 4.5765 0.1014 | ||
Likelihood Ratio Chi-Square 2 4.6789 0.0964 | ||
Phi Coefficient 0.1513 | ||
Contingency Coefficient 0.1496 | ||
Cramer's V 0.1513 | ||
---------------------------------------------------- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# output from ifr_chisq_gof_test is as expected | ||
|
||
Code | ||
ifr_chisq_gof_test(hsb, race, c(20, 20, 20, 140)) | ||
Output | ||
Test Statistics | ||
----------------------- | ||
Chi-Square 5.0286 | ||
DF 3 | ||
Pr > Chi Sq 0.1697 | ||
Sample Size 200 | ||
Variable: race | ||
----------------------------------------------------------------- | ||
Category Observed Expected % Deviation Std. Residuals | ||
----------------------------------------------------------------- | ||
1 24 20 20.00 0.89 | ||
2 11 20 -45.00 -2.01 | ||
3 20 20 0.00 0.00 | ||
4 145 140 3.57 0.42 | ||
----------------------------------------------------------------- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# output from cochran test is as expected | ||
|
||
Code | ||
ifr_cochran_qtest(exam, exam1, exam2, exam3) | ||
Output | ||
Test Statistics | ||
---------------------- | ||
N 15 | ||
Cochran's Q 4.75 | ||
df 2 | ||
p value 0.093 | ||
---------------------- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
# output from independent sample t test is as expected when alternative is less | ||
|
||
Code | ||
ifr_ts_ind_ttest(hsb, female, write, alternative = "less") | ||
Output | ||
Group Statistics | ||
----------------------------------------------------------------------------- | ||
Group Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] | ||
----------------------------------------------------------------------------- | ||
0 91 50.121 1.080 10.305 47.97539 52.26661 | ||
1 109 54.991 0.779 8.134 53.44689 56.53511 | ||
----------------------------------------------------------------------------- | ||
combined 200 52.775 0.67 9.479 51.45379 54.09621 | ||
----------------------------------------------------------------------------- | ||
diff 200 -4.87 1.304 9.231 -7.42623 -2.31377 | ||
----------------------------------------------------------------------------- | ||
Independent Samples Test | ||
------------------------ | ||
Ho: mean(0) - mean(1) = diff = 0 | ||
Ha: diff < 0 | ||
--------------------------------------------------------------------- | ||
Variable Method Variances DF t Value P < t | ||
--------------------------------------------------------------------- | ||
write Pooled Equal 198 -3.7341 0.0001 | ||
write Satterthwaite Unequal 170 -3.6564 0.0002 | ||
--------------------------------------------------------------------- | ||
Test for Equality of Variances | ||
--------------------------------------------------------------- | ||
Variable Method Num DF Den DF F Value P > F | ||
--------------------------------------------------------------- | ||
write Folded F 90 108 1.605 0.0188 | ||
--------------------------------------------------------------- | ||
|
||
# output from independent sample t test is as expected when alternative is greater | ||
|
||
Code | ||
ifr_ts_ind_ttest(hsb, female, write, alternative = "greater") | ||
Output | ||
Group Statistics | ||
----------------------------------------------------------------------------- | ||
Group Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] | ||
----------------------------------------------------------------------------- | ||
0 91 50.121 1.080 10.305 47.97539 52.26661 | ||
1 109 54.991 0.779 8.134 53.44689 56.53511 | ||
----------------------------------------------------------------------------- | ||
combined 200 52.775 0.67 9.479 51.45379 54.09621 | ||
----------------------------------------------------------------------------- | ||
diff 200 -4.87 1.304 9.231 -7.42623 -2.31377 | ||
----------------------------------------------------------------------------- | ||
Independent Samples Test | ||
------------------------ | ||
Ho: mean(0) - mean(1) = diff = 0 | ||
Ha: diff > 0 | ||
--------------------------------------------------------------------- | ||
Variable Method Variances DF t Value P > t | ||
--------------------------------------------------------------------- | ||
write Pooled Equal 198 -3.7341 0.9999 | ||
write Satterthwaite Unequal 170 -3.6564 0.9998 | ||
--------------------------------------------------------------------- | ||
Test for Equality of Variances | ||
--------------------------------------------------------------- | ||
Variable Method Num DF Den DF F Value P > F | ||
--------------------------------------------------------------- | ||
write Folded F 90 108 1.605 0.0188 | ||
--------------------------------------------------------------- | ||
|
||
# output from independent sample t test is as expected when alternative is both | ||
|
||
Code | ||
ifr_ts_ind_ttest(hsb, female, write, alternative = "both") | ||
Output | ||
Group Statistics | ||
----------------------------------------------------------------------------- | ||
Group Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] | ||
----------------------------------------------------------------------------- | ||
0 91 50.121 1.080 10.305 47.97539 52.26661 | ||
1 109 54.991 0.779 8.134 53.44689 56.53511 | ||
----------------------------------------------------------------------------- | ||
combined 200 52.775 0.67 9.479 51.45379 54.09621 | ||
----------------------------------------------------------------------------- | ||
diff 200 -4.87 1.304 9.231 -7.42623 -2.31377 | ||
----------------------------------------------------------------------------- | ||
Independent Samples Test | ||
------------------------ | ||
Ho: mean(0) - mean(1) = diff = 0 | ||
Ha: diff ~= 0 | ||
--------------------------------------------------------------------- | ||
Variable Method Variances DF t Value P > |t| | ||
--------------------------------------------------------------------- | ||
write Pooled Equal 198 -3.7341 0.0002 | ||
write Satterthwaite Unequal 170 -3.6564 0.0003 | ||
--------------------------------------------------------------------- | ||
Test for Equality of Variances | ||
--------------------------------------------------------------- | ||
Variable Method Num DF Den DF F Value P > F | ||
--------------------------------------------------------------- | ||
write Folded F 90 108 1.605 0.0188 | ||
--------------------------------------------------------------- | ||
|
||
# output from independent sample t test is as expected when alternative is all | ||
|
||
Code | ||
ifr_ts_ind_ttest(hsb, female, write, alternative = "all") | ||
Output | ||
Group Statistics | ||
----------------------------------------------------------------------------- | ||
Group Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] | ||
----------------------------------------------------------------------------- | ||
0 91 50.121 1.080 10.305 47.97539 52.26661 | ||
1 109 54.991 0.779 8.134 53.44689 56.53511 | ||
----------------------------------------------------------------------------- | ||
combined 200 52.775 0.67 9.479 51.45379 54.09621 | ||
----------------------------------------------------------------------------- | ||
diff 200 -4.87 1.304 9.231 -7.42623 -2.31377 | ||
----------------------------------------------------------------------------- | ||
Independent Samples Test | ||
------------------------ | ||
Ho: mean(0) - mean(1) = diff = 0 | ||
Ha: diff < 0 Ha: diff ~= 0 Ha: diff > 0 | ||
Pooled | ||
------------------------------------------------------------------------ | ||
t = -3.7341 t = -3.7341 t = -3.7341 | ||
P < t = 0.0001 P > |t| = 0.0002 P > t = 0.9999 | ||
Satterthwaite | ||
------------------------------------------------------------------------ | ||
t = -3.6564 t = -3.6564 t = -3.6564 | ||
P < t = 0.0002 P > |t| = 0.0003 P > t = 0.9998 | ||
Test for Equality of Variances | ||
--------------------------------------------------------------- | ||
Variable Method Num DF Den DF F Value P > F | ||
--------------------------------------------------------------- | ||
write Folded F 90 108 1.605 0.0188 | ||
--------------------------------------------------------------- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# output from levene test is as expected | ||
|
||
Code | ||
ifr_levene_test(hsb, read, group_var = race) | ||
Output | ||
Summary Statistics | ||
Levels Frequency Mean Std. Dev | ||
----------------------------------------- | ||
1 24 46.67 10.24 | ||
2 11 51.91 7.66 | ||
3 20 46.8 7.12 | ||
4 145 53.92 10.28 | ||
----------------------------------------- | ||
Total 200 52.23 10.25 | ||
----------------------------------------- | ||
Test Statistics | ||
------------------------------------------------------------------------- | ||
Statistic Num DF Den DF F Pr > F | ||
------------------------------------------------------------------------- | ||
Brown and Forsythe 3 196 3.44 0.0179 | ||
Levene 3 196 3.4792 0.017 | ||
Brown and Forsythe (Trimmed Mean) 3 196 3.3936 0.019 | ||
------------------------------------------------------------------------- | ||
|
Oops, something went wrong.