Room for the Intercept
A regression in statsmodels has no intercept unless the data carry a column of 1s for it. Return x as a table with that column of 1s in front and the values of x as the second column.
Example 1
x [3,5,8]
returns [[1.0,3.0],[1.0,5.0],[1.0,8.0]]
Each row is a 1 followed by the value.
Constraints
2 <= len(x) <= 40- The values are not all equal
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More statsmodels problems
- Slope From a TableBeginner
- What the Line MissesBeginner
- Echo of YesterdayEasy
- Fair R SquaredEasy
- Group GapsEasy
- Is the Share DifferentEasy
- Is the Slope RealEasy
- Prices for New RowsEasy