Last active
April 12, 2016 20:23
-
-
Save githoov/417c2c7319bf8d7329ea368c54fed676 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # input queries | |
| # tickets: https://metanew.looker.com/x/CQ9zcpw | |
| # discourse views: https://metanew.looker.com/x/yYf3CPH | |
| # load data | |
| tickets <- read.csv(file = "~/Downloads/ticket_topics.csv", header = TRUE) | |
| articles <- read.csv(file = "~/Downloads/discourse_topics.csv", header = TRUE) | |
| # rename columns | |
| names(tickets) <- c("week", "topic", "chats") | |
| names(articles) <- c("week", "topic", "views") | |
| # inner join tickets and articles. implicitly inner joins on shared column names | |
| df <- merge(articles, tickets) | |
| # naive regression | |
| summary(lm(chats ~ views + topic + time(week), data = df)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment