FunctionRacerProblemsRace

Range for the Slope

EasystatsmodelsPython

Fit an ordinary least squares line to the points (x[i], y[i]) and return [low, high]: the confidence interval of its slope at confidence level level (such as 0.95).

Example 1

x [0,1,2,3]
y [0,1,0,1]
level 0.95
returns [-1.0169739689035808,1.4169739689035807]

The interval runs from about -1.02 to 1.42 and contains 0.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More statsmodels problems