Skip to content
Permalink
Browse files

Evaluation

  • Loading branch information...
emjun committed Apr 5, 2019
1 parent a08e74a commit c7c1aa0b08c9b360fe41e4ac49723a5d8350d781
Showing with 12 additions and 4 deletions.
  1. +3 −1 evaluation/evaluation.R
  2. +5 −1 tea/evaluate.py
  3. +2 −0 tea/evaluate_helper_methods.py
  4. +2 −2 tests/integration_tests/test_integration.py
@@ -59,6 +59,7 @@ rcorr(liarMatrix)
cor(liarData$Position, liarData$Creativity, method = "kendall")
cor(liarData$Position, liarData$Creativity, method = "spearman")
cor.test(liarData$Position, liarData$Creativity, alternative = "less", method = "pearson")
cor.test(liarData$Position, liarData$Creativity, alternative = "less", method = "kendall")

### Pointbiseral (p. 229 -233)
# Field et al.
@@ -77,6 +78,7 @@ prop.table(catFrequencies)
### Independent T-Test
# Kabacoff (p. 164-165)
library (MASS)
t.test(Prob ~ So, data=UScrime)
t.test(Prob ~ So, data=UScrime, var.equal=TRUE)
# could also be written as
# t.test(y1, y2) # y1 and y2 dependent variables for the two groups
@@ -309,7 +311,7 @@ catData <- read.delim("/Users/emjun/Git/tea-lang/evaluation/discovering-statisti
food <- c(10, 28)
affection <- c(114, 48)
catsTable <- cbind(food, affection)
CrossTable(catsData$Training, catsData$Dance, fisher = TRUE, chisq = TRUE, expected = TRUE, sresid = TRUE, format = "SPSS")
CrossTable(catData$Training, catData$Dance, fisher = TRUE, chisq = TRUE, expected = TRUE, sresid = TRUE, format = "SPSS")
# Equivalent to the above
#CrossTable(catsTable, fisher = TRUE, chisq = TRUE, expected = TRUE, sresid = TRUE, format = "SPSS")
#CrossTable(catsData$Training, catsData$Dance, fisher = TRUE, chisq = TRUE, expected = TRUE, prop.c = FALSE, prop.t = FALSE, prop.chisq = FALSE, sresid = TRUE, format = "SPSS")
@@ -395,14 +395,18 @@ def evaluate(dataset: Dataset, expr: Node, assumptions: Dict[str, str], design:
for test in tests:
test_result = execute_test(dataset, design, combined_data, test)
results[test] = test_result

if 'bootstrap' in tests:
# import pdb; pdb.set_trace()
pass

# TODO: Calculate effect size for experiments!!
# calculate_effect_size()
# import pdb; pdb.set_trace()

# TODO One-sided test?
if expr.predictions:
import pdb; pdb.set_trace()
# import pdb; pdb.set_trace()

# T-tests: may greater-than test when p/2 < alpha and t > 0, and of a less-than test when p/2 < alpha and t < 0
# --> may want to divide p-value in t-test (before return)
@@ -683,6 +683,8 @@ def bootstrap(dataset: Dataset, combined_data: CombinedData):
# store all the medians & confidence intervals
# return all the medians & CIs
# data.append(cat_data)

return calculations

# Interaction effects
# Add the interactions
@@ -302,8 +302,8 @@ def test_indep_t_test():
}
assumptions = {
'Type I (False Positive) Error Rate': 0.05,
'normal distribution': ['So'],
'groups normally distributed': [['So', 'Prob']]
# 'normal distribution': ['So'],
# 'groups normally distributed': [['So', 'Prob']]

}

0 comments on commit c7c1aa0

Please sign in to comment.
You can’t perform that action at this time.