stat_analysis Flashcards

1
Q

Suppose we want to simulate the probability of flipping a fair coin 20 times, and getting a number greater than or equal to 15.

Use Numpy to do 10,000 simulations of flipping a fair coin 20 times, then see what proportion of the simulations are 15 or greater.

A

x = np.random.binomial(20, .5, 10000)

print((x>=15).mean())

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Use Numpy to get the standard deviation for a variable ‘distribution’

A

np.st(distribution)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Given two DataFrames(early[‘assignment1_grade’], late[‘assignment2_grade’]), how do you use scipy to get the t-statistic and the pvalue?

A

from scipy import stats

stats.ttest_ind(early[‘assignment1_grade’], late[‘assignment_grade’])

How well did you know this?
1
Not at all
2
3
4
5
Perfectly