Giter Club home page Giter Club logo

mistat-code-solutions's People

Contributors

gedeck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mistat-code-solutions's Issues

Clarify Granger causality test

Describe the problem
The Granger causality test requires clarification why p-values are greater than the significance level. Statsmodels documentation states:

The Null hypothesis for grangercausalitytests is that the time series in the second column, x2, does NOT Granger cause the time series in the first column, x1. Grange causality means that past values of x2 have a statistically significant effect on the current value of x1, taking past values of x1 into account as regressors. We reject the null hypothesis that x2 does not Granger cause x1 if the pvalues are below a desired size of the test.

Suggested change
A clear and concise description of what you expected to happen.

Modern Statistics: PMF vs PDF

Describe the problem

Chapter 2, Page 55, section 2.2.1.1. The bolded words after equation 2.13: "probability distribution function," shouldn't that be called "probability mass function"?

MS-chapter 3: qqplot now creates only 5 lines

Change to code to create figures.

np.random.seed(1)
x = stats.norm(loc=10, scale=1).rvs(50)
fig, ax = plt.subplots(figsize=[5, 5])
pg.qqplot(x, ax=ax)
ax.get_lines()[0].set_color('grey')
ax.get_lines()[0].set_markerfacecolor('none')
ax.get_lines()[1].set_color('black')
ax.get_lines()[2].set_color('grey')
ax.get_lines()[3].set_color('grey')
plt.show()

Modern Statistics: Se clarification

Chapter 4, page 251, states that The square roots of these variances estimates are the "std err".... The Se value is shown in the regression summary output as Scale.
Page 250 states that Se^2 = 5.8869
Page 248 in the results summary states that Scale: 5.8832
Suspect there is rounding error, but none-the-less, the sqrt of 5.8832 = 2.426. Thus, Se =/= Scale

Problem:
The Scale output cannot be both variance and standard error.

https://www.statsmodels.org/dev/generated/statsmodels.regression.linear_model.OLSResults.scale.html
Note that the square root of scale is often called the standard error of the regression.

Solution:
The square roots of these variances estimates are the "std err".... The Se^2 value is shown in the regression summary output as Scale.

Modern Statistics: pandas iteritems deprecated

Describe the problem
The pandas method iteritems is deprecated which causes the code in Example 7.3 to fail.

Suggested change

  df = pd.DataFrame([
    {satisfaction: counts for satisfaction, counts
      in response.value_counts().iteritems()},
    {satisfaction: counts for satisfaction, counts
      in response[q1_5].value_counts().iteritems()},
  ])

with

  df = pd.DataFrame([
    {satisfaction: counts for satisfaction, counts
      in response.value_counts().items()},
    {satisfaction: counts for satisfaction, counts
      in response[q1_5].value_counts().items()},
  ])

Modern Statistics: ...

Describe the problem
Ask Springer to change this line on their website:

The mistat Python package can be accessed at https://gedeck.github.io/mistat-code-solutions/ModernStatistics/

Link should be clickable and should reference as source for code and solutions.

Suggested change
???

Modern Statistics: ...

Describe the problem
Chapter 3 Page 162 Equation 3.30

The lower interval's denominator missing "/2" in the subscript of the Chi-square symbol. Should appear as: Chi-Square 1-a/2[n-1].

Chapter 3 page 152

Describe the problem
The P-value explained at the top of page 152 but there is no reference to it in the index

Suggested change
Add "p. 152" to the P-value entry in the index on page 437.

Screenshots
If applicable, add screenshots to help explain your problem.

Software (if the problem is with the code):

  • OS: [e.g. iOS]
  • Python version [e.g. 3.10]

Additional context
Add any other context about the problem here.

Modern Statistics: Updates required

Describe the problem
DtreeViz has a changed API

Suggested change
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Software (if the problem is with the code):

  • OS: [e.g. iOS]
  • Python version [e.g. 3.10]

Additional context
Add any other context about the problem here.

Modern Statistics: statsmodels API for anova has changed

Describe the problem
Error below when using mistat.stepwise_regression(outcome=y, all_vars=X, data=df3)

Software Error
File ~\mistat\regression\stepwiseRegression.py:19, in find_best_model_partialF(outcome, variable_sets, data, old_model, opt_max)
17 with warnings.catch_warnings():
18 warnings.simplefilter("ignore")
---> 19 comparison = sms.anova.anova_lm(old_model, new_model)
20 if optF * partialF < optF * comparison.F[1]:
21 best_vars = variables

AttributeError: module 'statsmodels.stats' has no attribute 'anova'

Suggested change
import statsmodels.api as sm
---> 19 comparison = sm.stats.anova_lm(old_model, new_model)

Software (if the problem is with the code):
OS: Windows
Release: 10
Python implementation: CPython
Python version : 3.11.0
IPython version : 8.12.0
statsmodels: 0.14.0

Hints on how to deal with Errors and Warnings

Add information at the top of the files on what to do when Errors or Warnings occur.

  • Warnings can usually be ignored
  • Errors - google for the error and recommend fixes
  • Check the repository for updated code

Industrial Statistics: Add installpackages.ipynb to zip file

Describe the problem
A clear and concise description of what the problem is.

Suggested change
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Software (if the problem is with the code):

  • OS: [e.g. iOS]
  • Python version [e.g. 3.10]

Additional context
Add any other context about the problem here.

Modern Statistics: Proportional Sample Allocation Ch. 5 pg 317 Equation Clarification

Proportional Sample Allocation Ch. 5 pg 317 Equation Clarification

The equation on page 317 in the top section under V$_{\text{simple}}$ ...

where
$\tilde{\sigma}_N^2 = \frac{N}{N-1}\sigma_N^2$

Should it read?:
$\tilde{\sigma}_{N_i}^2 = \frac{N_i}{N_i-1}\sigma_{N_i}^2$

I get the sense that it should because of how the equation for $\bar{\sigma}_N^2$ on page 318 is solved.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.