r109907 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109906‎ | r109907 | r109908 >
Date:08:07, 24 January 2012
Author:rfaulk
Status:deferred
Tags:
Comment:
modified the construction of some lists to fix issues with t-tests using NaN values
Modified paths:
  • /trunk/tools/wsor/message_templates/R/huggle3_analysis.R (modified) (history)

Diff [purge]

Index: trunk/tools/wsor/message_templates/R/huggle3_analysis.R
@@ -24,26 +24,40 @@
2525 max_ec_z65_ns_3 = max(append(metrics_ec_z65['ns_3_revisions_before'][[1]], metrics_ec_z65['ns_3_revisions_after'][[1]]))
2626
2727
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
2930
3031 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]]
3232 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]]
3435
35 -## Generate results:
 36+# z64_ns0 <- c()
 37+# z65_ns0 <- c()
 38+z64_ns3 <- c()
 39+z65_ns3 <- c()
3640
 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+
3756 summary(z65_ns0)
3857 summary(z64_ns0)
3958 summary(z65_ns3)
4059 summary(z64_ns3)
4160
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)
4463
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)))
4964
50 -

Status & tagging log