SHARE
TWEET

Untitled

a guest Feb 9th, 2017 194 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. require(RGoogleAnalytics)
  2.  
  3. client.id <- "995868658023-ae8a44dmm8sekj151918s3484tem9970.apps.googleusercontent.com"
  4. client.secret <- "0xsh2mPKzPsYfFKP62qmp68W"
  5. token <- Auth(client.id,client.secret)
  6.  
  7. save(token,file="./token_file2")
  8.  
  9. ValidateToken(token)
  10.  
  11. query.list <- Init(start.date = "2016-12-09",
  12.                    end.date = "2017-02-09",
  13.                    dimensions = "ga:devicecategory",
  14.                    metrics = "ga:users",
  15.                    max.results = 50000,
  16.                    table.id = "ga:81184577")
  17. ga.query <- QueryBuilder(query.list)
  18. ga.data <- GetReportData(ga.query, token, paginate_query = F)
  19. ga.data$CR<- ga.data$goal3Completions/ga.data$users*100
  20. prop.test(x = c(funnel$users.2[1], funnel$users.2[2]), n = c(funnel$users[1], funnel$users[2] ), alternative = c("less"),conf.level = 0.95, correct=TRUE)
  21. data_vizual<- plot(ga.data$date,ga.data$users , type="l", col="blue")
  22. data_vizual
  23.  
  24. library(plotly)
  25. boxplot1 <- plot_ly(ga.data, x = ~ga.data$users, color = ~ga.data$users, type = "box")
  26. p
  27. summary(ga.data$users)
  28.  
  29.  
  30. library(plotly)
  31. set.seed(100)
  32. d <- ga.data[sample(nrow(ga.data), 1000), ]
  33. plot_ly( x = ~ga.data$users, y = ~ga.data$date, color = ~ga.data$users,
  34.          size = ~ga.data$users, text = ~paste("Clarity: ", ga.data$users))
  35.  
  36.  
  37. require(bayesAB)
  38. A_test <- rbinom(14079, 0, .199)
  39. B_test <- rbinom(13972, 0, .222)
  40. A_TEST1 <- bayesTest(A_test, B_test, priors = c('alpha' = 50, 'beta' = 200), n_samples = 1e5, distribution = 'bernoulli')
  41. print(A_TEST1)
  42. summary(A_TEST1)
  43. plot(A_TEST1)
  44.  
  45. power.prop.test(p1=0.031, p2=0.038, power=0.9, alternative='one.sided', sig.level=0.01)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top