This may be very simple. Consider the following figure, minus the robot. How can I model the standard deviation of Speed as a function of Rep
I can chop the rep up into arbitrary pieces (e.g. 2000 Rep's), calculate the sd, and then draw a regression line between de standard deviations, I also thought about moving window but that doesn't seem right. Is there a better, more continuous way, irrespective of arbitrary binning, to model standard deviation as a function of x? In the end I would like to retrieve the beta coefficients; some R code would be great.
here is some data; e.g. slopes for the sd from the residuals of the following distribution, would also be happy if I could estimate the slopes of the s.d. directly from x,y :
n <- 1000
x <- runif(n)
y <- 1 - 2*x + x*rnorm(n)
plot(y~x)
r <- lm(y~x)
qplot(x,r$residuals)