Index: trunk/tools/wsor/message_templates/R/huggle3_analysis.R |
— | — | @@ -24,26 +24,40 @@ |
25 | 25 | max_ec_z65_ns_3 = max(append(metrics_ec_z65['ns_3_revisions_before'][[1]], metrics_ec_z65['ns_3_revisions_after'][[1]])) |
26 | 26 | |
27 | 27 | |
28 | | -# Compute edit count vectors -- normalize values by the maximum |
| 28 | +# Compute edit count vectors -- normalize values by the maximum, these are effectively representations of relative increase or decrease |
| 29 | +# of edit activity after the template has been placed |
29 | 30 | |
30 | 31 | z64_ns0 = (metrics_ec_z64['ns_0_revisions_before'][[1]] - metrics_ec_z64['ns_0_revisions_after'][[1]]) / metrics_ec_z64['ns_0_revisions_before'][[1]] |
31 | | -z64_ns3 = (metrics_ec_z64['ns_3_revisions_before'][[1]] - metrics_ec_z64['ns_3_revisions_after'][[1]]) / metrics_ec_z64['ns_3_revisions_before'][[1]] |
32 | 32 | z65_ns0 = (metrics_ec_z65['ns_0_revisions_before'][[1]] - metrics_ec_z65['ns_0_revisions_after'][[1]]) / metrics_ec_z65['ns_0_revisions_before'][[1]] |
33 | | -z65_ns3 = (metrics_ec_z65['ns_3_revisions_before'][[1]] - metrics_ec_z65['ns_3_revisions_after'][[1]]) / metrics_ec_z65['ns_3_revisions_before'][[1]] |
| 33 | +# z64_ns3 = (metrics_ec_z64['ns_3_revisions_before'][[1]] - metrics_ec_z64['ns_3_revisions_after'][[1]]) / metrics_ec_z64['ns_3_revisions_before'][[1]] |
| 34 | +# z65_ns3 = (metrics_ec_z65['ns_3_revisions_before'][[1]] - metrics_ec_z65['ns_3_revisions_after'][[1]]) / metrics_ec_z65['ns_3_revisions_before'][[1]] |
34 | 35 | |
35 | | -## Generate results: |
| 36 | +# z64_ns0 <- c() |
| 37 | +# z65_ns0 <- c() |
| 38 | +z64_ns3 <- c() |
| 39 | +z65_ns3 <- c() |
36 | 40 | |
| 41 | +# Only append non-zero results - do this for just namespace 3 since it has zero entries for 'ns_3_revisions_before' |
| 42 | + |
| 43 | +for (i in 1:length(metrics_ec_z64['ns_3_revisions_before'][[1]])) |
| 44 | + if (metrics_ec_z64['ns_3_revisions_before'][[1]][i] != 0) |
| 45 | + z64_ns3 <- c(z64_ns3, |
| 46 | + (metrics_ec_z64['ns_3_revisions_before'][[1]][i] - metrics_ec_z64['ns_3_revisions_after'][[1]][i]) / metrics_ec_z64['ns_3_revisions_before'][[1]][i]) |
| 47 | + |
| 48 | +for (i in 1:length(metrics_ec_z65['ns_3_revisions_before'][[1]])) |
| 49 | + if (metrics_ec_z65['ns_3_revisions_before'][[1]][i] != 0) |
| 50 | + z65_ns3 <- c(z65_ns3, |
| 51 | + (metrics_ec_z65['ns_3_revisions_before'][[1]][i] - metrics_ec_z65['ns_3_revisions_after'][[1]][i]) / metrics_ec_z65['ns_3_revisions_before'][[1]][i]) |
| 52 | + |
| 53 | + |
| 54 | +# Generate results: |
| 55 | + |
37 | 56 | summary(z65_ns0) |
38 | 57 | summary(z64_ns0) |
39 | 58 | summary(z65_ns3) |
40 | 59 | summary(z64_ns3) |
41 | 60 | |
42 | | -t_result_ns0 = t.test(x=z64_ns0, y=z65_ns0, alternative = "two.sided", paired = TRUE, var.equal = FALSE, conf.level = 0.95) |
43 | | -t_result_ns3 = t.test(x=z64_ns3, y=z65_ns3, alternative = "two.sided", paired = TRUE, var.equal = FALSE, conf.level = 0.95) |
| 61 | +t_result_ns0 = t.test(x=z64_ns0, y=z65_ns0, alternative = "two.sided", paired = FALSE, var.equal = FALSE, conf.level = 0.95) |
| 62 | +t_result_ns3 = t.test(x=z64_ns3, y=z65_ns3, alternative = "two.sided", paired = FALSE, var.equal = FALSE, conf.level = 0.95) |
44 | 63 | |
45 | | -# combined = merge(postings, metrics_ec, by=c("recipient_name", "timestamp")) |
46 | | -# summary(postings) |
47 | | -# Number of message recipients grouped by previous main namespace edits and order of magnitude |
48 | | -# table(10^round(log(combined$ns_0_revisions_before, base=10))) |
49 | 64 | |
50 | | - |