eric p
eric p

Reputation: 235

simulating data from regression line in python

If I have a regression line and an r squared is there a simple numpy (or some other library) command to randomly draw, say, y values for an x that are consistent with the regression? The same way you could just draw a random value from a distribution?

Thanks!

Upvotes: 1

Views: 279

Answers (1)

ev-br
ev-br

Reputation: 26070

A way to go would be to get the parameter values from the regression and use an appropriate distribution from either numpy or scipy.

Upvotes: 1

Related Questions