-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
trend lines for log plots #6
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On mouseover should display 7-day trend line, this is it in R
# Assume a csv with headers "Cases" and "day", the latter starting at 1
# and read it into data
data <- read.csv(datafile)
# eyeball it on a linear scale to see if it looks right
plot(data$day,data$Cases)
# linear regression on base 2 log of cases vs days, 22-26 observations only
fit <- lm( data[22:26,"day"] ~ log2(data[22:26,"Cases"]) )
# spit out the doubling time in days
fit$coef[2]
The text was updated successfully, but these errors were encountered: