513 lines
24 KiB
R
513 lines
24 KiB
R
data1$new_milestones <- as.numeric(data1$milestones > 0) + 1
|
|
# (2) - Run the model on the pilot data
|
|
data1$formal.score <- data1$mmt / (data1$old_milestones/data1$age)
|
|
table(data1$milestones)
|
|
table(data1$old_milestones)
|
|
hist(data1$old_mmt, prob=TRUE) #inequality of participation
|
|
hist(data1$formal.score)
|
|
data1$new_mmt <- data1$mmt - 1
|
|
hist(data1$new_mmt, prob=TRUE)
|
|
data1$new.age <- as.numeric(cut(data1$age/365, breaks=c(0,9,12,15,17), labels=c(1,2,3,4)))
|
|
data1$new.formal.score <- data1$mmt / (data1$new_milestones/data1$new.age)
|
|
hist(as.numeric(data1$new.age))
|
|
hist(data1$formal.score)
|
|
hist(data1$new.formal.score)
|
|
fsmodel1 <- lm(up.fac.mean ~ formal.score, data=data1)
|
|
summary(kmodel1)
|
|
summary(fsmodel1)
|
|
kmodel3 <- lm(up.fac.mean ~ formal.score, data=data1)
|
|
# (2) - Run the model on the pilot data
|
|
data1$formal.score <- data1$mmt / (data1$old_milestones/data1$age)
|
|
table(data1$formal.score)
|
|
fsmodel1 <- lm(up.fac.mean ~ is.finite(formal.score), data=data1)
|
|
summary(fsmodel1)
|
|
fsmodel2 <- lm(up.fac.mean ~ new.formal.score, data=data1)
|
|
summary(kmodel2)
|
|
summary(fsmodel2)
|
|
mmtmodel1 <- lm(up.fac.mean ~ mmt, data=data1)
|
|
summary(mmtmodel1)
|
|
agemodel1 <- lm(up.fac.mean ~ new.age, data=data1)
|
|
summary(agemodel1)
|
|
msmodel1 <- lm(up.fac.mean ~ old_milestones, data=data1)
|
|
summary(msmodel1)
|
|
msmodel2 <- lm(up.fac.mean ~ new_milestones, data=data1)
|
|
summary(msmodel2)
|
|
texreg(list(m1,m2,m3,m4), omit.coef = 'factor', stars=NULL, digits=2,
|
|
custom.model.names=c('M1: no lang/network measures', 'M2: No language measures', 'M3: No network measures', 'M4: Full model'),
|
|
custom.coef.names=c('(Intercept)', 'Package Age (years)', 'Uploader Count', 'Did maintainer change?', 'Team proportion', 'Eigenvector Centrality', 'Betweenness Centrality', 'Mean Language Age', 'Package Age : Mean Language Age'),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
install.packages(textref)
|
|
install.packages(textreg)
|
|
library(textreg)
|
|
install.packages("textreg_0.1.tar.gz", repos = NULL, type="source")
|
|
install.packages("textreg_0.1.tar.gz", repos = NULL, type="source")
|
|
install.packages("textreg_0.1.5.tar.gz", repos = NULL, type="source")
|
|
import.packages(tm)
|
|
import.package(tm)
|
|
import.package("tm")
|
|
install.package("tm")
|
|
install.packages("tm")
|
|
install.packages("nlp")
|
|
yes
|
|
install.packages("textreg_0.1.5.tar.gz", repos = NULL, type="source")
|
|
library(textreg)
|
|
texreg(list(m1,m2,m3,m4), omit.coef = 'factor', stars=NULL, digits=2,
|
|
custom.model.names=c('M1: no lang/network measures', 'M2: No language measures', 'M3: No network measures', 'M4: Full model'),
|
|
custom.coef.names=c('(Intercept)', 'Package Age (years)', 'Uploader Count', 'Did maintainer change?', 'Team proportion', 'Eigenvector Centrality', 'Betweenness Centrality', 'Mean Language Age', 'Package Age : Mean Language Age'),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
textreg(list(m1,m2,m3,m4), omit.coef = 'factor', stars=NULL, digits=2,
|
|
custom.model.names=c('M1: no lang/network measures', 'M2: No language measures', 'M3: No network measures', 'M4: Full model'),
|
|
custom.coef.names=c('(Intercept)', 'Package Age (years)', 'Uploader Count', 'Did maintainer change?', 'Team proportion', 'Eigenvector Centrality', 'Betweenness Centrality', 'Mean Language Age', 'Package Age : Mean Language Age'),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
textreg(list(fsmodel1,fsmodel2), omit.coef = 'factor', stars=NULL, digits=2,
|
|
custom.model.names=c('M1: original formality score', 'M2: augmented formality score'),
|
|
custom.coef.names=c('(Intercept)', 'Package Age (years)', 'Uploader Count', 'Did maintainer change?', 'Team proportion', 'Eigenvector Centrality', 'Betweenness Centrality', 'Mean Language Age', 'Package Age : Mean Language Age'),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
coeff(fsmodel1)
|
|
coef(fsmodel1)
|
|
textreg(list(fsmodel1,fsmodel2), omit.coef = 'factor', stars=NULL, digits=2,
|
|
custom.model.names=c('M1: original formality score', 'M2: augmented formality score'),
|
|
custom.coef.names=c('(Intercept)', 'Package Age (years)'),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
coef(fsmodel2)
|
|
textreg(list(fsmodel1,fsmodel2), stars=NULL, digits=2,
|
|
custom.model.names=c('M1: original formality score', 'M2: augmented formality score'),
|
|
custom.coef.names=c('(Intercept)', 'Package Age (years)'),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
textreg(list(fsmodel1,fsmodel2), stars=NULL, digits=2,
|
|
custom.model.names=c('M1: original formality score', 'M2: augmented formality score'),
|
|
custom.coef.names=c('(Intercept)', 'Package Age (years)'),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
texreg(list(fsmodel1,fsmodel2), stars=NULL, digits=2,
|
|
custom.model.names=c('M1: original formality score', 'M2: augmented formality score'),
|
|
custom.coef.names=c('(Intercept)', 'Package Age (years)'),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
install.packages(texreg)
|
|
install.packages("texreg_1.39.3.tar.gz", repos = NULL, type="source")
|
|
library(texreg)
|
|
texreg(list(fsmodel1,fsmodel2), omit.coef = 'factor', stars=NULL, digits=2,
|
|
custom.model.names=c('M1: original formality score', 'M2: augmented formality score'),
|
|
custom.coef.names=c('(Intercept)', 'Package Age (years)'),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
texreg(list(fsmodel1,fsmodel2), omit.coef = 'factor', stars=NULL, digits=2,
|
|
custom.model.names=c('M1: original formality score', 'M2: augmented formality score'),
|
|
custom.coef.names=c('(Intercept)', 'Package Age (years)', 'test'),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
texreg(list(fsmodel1,fsmodel2, mmtmodel1, msmodel1, msmodel2, agemodel1), omit.coef = 'factor', stars=NULL, digits=2,
|
|
custom.model.names=c('M1: original formality score', 'M2: augmented formality score', 'M3: original milestones', 'M4: binomial milestones', 'M5: age (grouped)' ),
|
|
custom.coef.names=c('(Intercept)', 'Package Age (years)', 'test'),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
texreg(list(fsmodel1,fsmodel2, mmtmodel1, msmodel1, msmodel2, agemodel1), omit.coef = 'factor', stars=NULL, digits=2,
|
|
custom.model.names=c('M1: original formality score', 'M2: augmented formality score', 'M3: original milestones', 'M4: binomial milestones', 'M5: age (grouped)' ),
|
|
custom.coef.names=c('(Intercept)', 'Package Age (years)', 'test', 'test', 'test', 'test', 'test', ),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
texreg(list(fsmodel1,fsmodel2, mmtmodel1, msmodel1, msmodel2, agemodel1), omit.coef = 'factor', stars=NULL, digits=2,
|
|
custom.model.names=c('M1: original formality score', 'M2: augmented formality score', 'M3: original milestones', 'M4: binomial milestones', 'M5: age (grouped)' ),
|
|
custom.coef.names=c('(Intercept)', 'Package Age (years)', 'test', 'test', 'test', 'test', 'test' ),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
texreg(list(fsmodel1,fsmodel2, mmtmodel1, msmodel1, msmodel2, agemodel1), omit.coef = 'factor', stars=NULL, digits=2,
|
|
custom.model.names=c('M1: original formality score', 'M2: augmented formality score','M3: MMT', 'M4: original milestones', 'M5: binomial milestones', 'M6: age (grouped)' ),
|
|
custom.coef.names=c('(Intercept)', 'Package Age (years)', 'test', 'test', 'test', 'test', 'test' ),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
texreg(list(fsmodel1,fsmodel2, mmtmodel1, msmodel1, msmodel2, agemodel1), omit.coef = 'factor', stars=NULL, digits=2,
|
|
custom.model.names=c('M1: original formality score', 'M2: augmented formality score','M3: MMT', 'M4: original milestones', 'M5: binomial milestones', 'M6: age (grouped)' ),
|
|
custom.coef.names=c('(Intercept)', 'Package Age (years)', 'Relationship to Underproduction', 'test', 'test', 'test', 'test' ),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
texreg(list(fsmodel1,fsmodel2, mmtmodel1, msmodel1, agemodel1), omit.coef = 'factor', stars=NULL, digits=2,
|
|
custom.model.names=c('M1: original formality score', 'M2: augmented formality score','M3: MMT', 'M4: original milestones', 'M6: age (grouped)' ),
|
|
custom.coef.names=c('Original formality relationship to underproduction', 'Augmented formality relationship to Underproduction', 'MMT relationship to underproduction', 'milestone usage relationship to underproduction', 'age group relationship to underproduction' ),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
texreg(list(fsmodel1,fsmodel2, mmtmodel1, msmodel1, agemodel1), omit.coef = 'factor', stars=NULL, digits=2,
|
|
custom.model.names=c('M1: original formality score', 'M2: augmented formality score','M3: MMT', 'M4: original milestones', 'M6: age (grouped)' ),
|
|
custom.coef.names=c('Original formality relationship to underproduction', 'Augmented formality relationship to Underproduction', 'MMT relationship to underproduction', 'milestone usage relationship to underproduction', 'age group relationship to underproduction', 'test' ),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
texreg(list(fsmodel1,fsmodel2, mmtmodel1, msmodel1, agemodel1), omit.coef = 'factor', stars=NULL, digits=2,
|
|
custom.model.names=c('M1: original formality score', 'M2: augmented formality score','M3: MMT', 'M4: original milestones', 'M6: age (grouped)' ),
|
|
custom.coef.names=c('(Intercept)', 'Original formality relationship to underproduction', 'Augmented formality relationship to Underproduction', 'MMT relationship to underproduction', 'Milestone usage relationship to underproduction', 'Age group relationship to underproduction'),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
data5 <- subset(data1, is.finite(data1$formal.score))
|
|
fsmodel1 <- lm(up.fac.mean ~ formal.score, data=data5)
|
|
summary(fsmodel1)
|
|
texreg(list(fsmodel1,fsmodel2, mmtmodel1, msmodel1, agemodel1), omit.coef = 'factor', stars=NULL, digits=2,
|
|
custom.model.names=c('M1: original formality score', 'M2: augmented formality score','M3: MMT', 'M4: original milestones', 'M6: age (grouped)' ),
|
|
custom.coef.names=c('(Intercept)', 'Original formality relationship to underproduction', 'Augmented formality relationship to Underproduction', 'MMT relationship to underproduction', 'Milestone usage relationship to underproduction', 'Age group relationship to underproduction'),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
texreg(list(fsmodel1,fsmodel2, mmtmodel1, msmodel1, agemodel1), omit.coef = 'factor', stars=NULL, digits=2,
|
|
custom.model.names=c('M1: orig. formality', 'M2: augm. formality','M3: MMT', 'M4: milestones', 'M6: age (grouped)' ),
|
|
custom.coef.names=c('(Intercept)', 'Original formality/underproduction', 'Augmented formality/Underproduction', 'MMT/underproduction', 'Milestones / underproduction', 'Age/underproduction'),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
texreg(list(fsmodel1,fsmodel2, mmtmodel1, msmodel1, agemodel1), omit.coef = 'factor', stars=NULL, digits=2,
|
|
custom.model.names=c('M1: orig. formality', 'M2: augm. formality','M3: MMT', 'M4: milestones', 'M5: age (grouped)' ),
|
|
custom.coef.names=c('(Intercept)', 'Original formality', 'Augmented formality', 'MMT', 'Milestones', 'Age'),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
texreg(list(fsmodel2, mmtmodel1, msmodel1, agemodel1), omit.coef = 'factor', stars=NULL, digits=2,
|
|
custom.model.names=c( 'M1: augm. formality','M2: MMT', 'M3: milestones', 'M4: age (grouped)' ),
|
|
custom.coef.names=c('(Intercept)', 'Original formality', 'Augmented formality', 'MMT', 'Milestones', 'Age'),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
texreg(list(fsmodel2, mmtmodel1, msmodel1, agemodel1), omit.coef = 'factor', stars=NULL, digits=2,
|
|
custom.model.names=c( 'M1: augm. formality','M2: MMT', 'M3: milestones', 'M4: age (grouped)' ),
|
|
custom.coef.names=c('(Intercept)', 'Augmented formality', 'MMT', 'Milestones', 'Age'),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
#Sample values
|
|
powerCheck(300, 1000)
|
|
source('powerAnalysis.R') #my little "lib"
|
|
#Sample values
|
|
powerCheck(300, 1000)
|
|
powerCheck(200, 1000)
|
|
powerCheck(250, 1000)
|
|
powerCheck(275, 5000)
|
|
powerCheck(275, 1000)
|
|
source('powerAnalysis.R') #my little "lib"
|
|
#Sample values
|
|
powerCheck(300, 1000)
|
|
powerCheck(275, 1000)
|
|
powerCheck(500, 1000)
|
|
powerCheck(700, 1000)
|
|
powerCheck(7000, 1000)
|
|
fsmodel2 <- lm(up.fac.mean ~ new.formal.score + as.factor(new.age), data=data1)
|
|
summary(fsmodel2)
|
|
mmtmodel1 <- lm(up.fac.mean ~ mmt + as.factor(new.age), data=data1)
|
|
summary(mmtmodel1)
|
|
mmtmodel1 <- lm(up.fac.mean ~ mmt + as.factor(age), data=data1)
|
|
summary(mmtmodel1)
|
|
mmtmodel1 <- lm(up.fac.mean ~ mmt + as.factor(new.age), data=data1)
|
|
summary(mmtmodel1)
|
|
msmodel1 <- lm(up.fac.mean ~ old_milestones + as.factor(new.age), data=data1)
|
|
summary(msmodel1)
|
|
fsmodel2 <- lm(up.fac.mean ~ new.formal.score + as.factor(new.age), data=data1)
|
|
summary(fsmodel2)
|
|
texreg(list(fsmodel2, mmtmodel1, msmodel1, agemodel1), omit.coef = 'factor', stars=NULL, digits=2,
|
|
custom.model.names=c( 'M1: augm. formality','M2: MMT', 'M3: milestones' ),
|
|
custom.coef.names=c('(Intercept)', 'Augmented formality', 'MMT', 'Milestones'),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
texreg(list(fsmodel2, mmtmodel1, msmodel1, agemodel1), omit.coef = 'factor', stars=NULL, digits=2,
|
|
custom.model.names=c( 'M1: augm. formality','M2: MMT', 'M3: milestones' ),
|
|
custom.coef.names=c('(Intercept)', 'Augmented formality', 'MMT', 'Milestones', 'test'),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
texreg(list(fsmodel2, mmtmodel1, msmodel1), omit.coef = 'factor', stars=NULL, digits=2,
|
|
custom.model.names=c( 'M1: augm. formality','M2: MMT', 'M3: milestones' ),
|
|
custom.coef.names=c('(Intercept)', 'Augmented formality', 'MMT', 'Milestones', 'test'),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
texreg(list(fsmodel2, mmtmodel1, msmodel1), omit.coef = 'factor', stars=NULL, digits=2,
|
|
custom.model.names=c( 'M1: augm. formality','M2: MMT', 'M3: milestones' ),
|
|
custom.coef.names=c('(Intercept)', 'Augmented formality', 'MMT', 'Milestones'),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
source('powerAnalysis.R') #my little "lib"
|
|
powerCheck(250, 1000)
|
|
powerCheck(275, 1000)
|
|
#Sample values
|
|
powerCheck(300, 1000)
|
|
summary(mmtmodel1)
|
|
texreg(list(fsmodel2, mmtmodel1, msmodel1), stars=NULL, digits=2,
|
|
custom.model.names=c( 'M1: augm. formality','M2: MMT', 'M3: milestones' ),
|
|
custom.coef.names=c('(Intercept)', 'Augmented formality', 'MMT', 'Milestones'),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
texreg(list(fsmodel2, mmtmodel1, msmodel1), stars=NULL, digits=2,
|
|
custom.model.names=c( 'M1: augm. formality','M2: MMT', 'M3: milestones' ),
|
|
custom.coef.names=c('(Intercept)', 'Augmented formality', 'MMT', 'Milestones', 'age 2', 'age 3', 'age 4'),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
mmtmodel1 <- lm(up.fac.mean ~ mmt + as.factor(new.age), data=data1)
|
|
msmodel1 <- lm(up.fac.mean ~ old_milestones + as.factor(new.age), data=data1)
|
|
fsmodel2 <- lm(up.fac.mean ~ new.formal.score, data=data1)
|
|
texreg(list(fsmodel2, mmtmodel1, msmodel1), stars=NULL, digits=2,
|
|
custom.model.names=c( 'M1: augm. formality','M2: MMT', 'M3: milestones' ),
|
|
custom.coef.names=c('(Intercept)', 'Augmented formality', 'MMT', 'Milestones', 'age 2', 'age 3', 'age 4'),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
texreg(list(fsmodel2, mmtmodel1, msmodel1), stars=NULL, digits=2,
|
|
custom.model.names=c( 'M1: augm. formality','M2: MMT', 'M3: milestones' ),
|
|
custom.coef.names=c('(Intercept)', 'Augmented formality', 'MMT', 'age 2', 'age 3', 'age 4', 'Milestones'),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
summary(msmodel1)
|
|
texreg(list(fsmodel2, mmtmodel1, msmodel1), stars=NULL, digits=2,
|
|
custom.model.names=c( 'M1: augm. formality','M2: MMT', 'M3: milestones' ),
|
|
custom.coef.names=c('(Intercept)', 'Augmented formality', 'MMT', 'Age-2', 'Age-3', 'Age-4', 'Milestones'),
|
|
use.packages=FALSE, table=FALSE, ci.force = TRUE)
|
|
g <- ggplot(data1, aes(x=mmt, y=up.fac.mean)) +
|
|
geom_point() +
|
|
aes(x=mmt, y=up.fac.mean, color=new.age)+
|
|
geom_smooth() +
|
|
xlab("MMT") +
|
|
ylab("Underproduction Factor") +
|
|
theme_bw()
|
|
g
|
|
library(ggplot2)
|
|
g <- ggplot(data1, aes(x=mmt, y=up.fac.mean)) +
|
|
geom_point() +
|
|
aes(x=mmt, y=up.fac.mean, color=new.age)+
|
|
geom_smooth() +
|
|
xlab("MMT") +
|
|
ylab("Underproduction Factor") +
|
|
theme_bw()
|
|
g
|
|
msmodel1 <- lm(up.fac.mean ~ old_milestones + as.factor(new.age), data=data1)
|
|
summary(msmodel1)
|
|
g <- ggplot(data1, aes(x=mmt, y=up.fac.mean)) +
|
|
geom_point() +
|
|
aes(x=mmt, y=up.fac.mean, color=new.age)+
|
|
geom_smooth() +
|
|
xlab("MMT") +
|
|
ylab("Underproduction Factor") +
|
|
theme_bw()+
|
|
scale_color_brewer(palette="Dark2")
|
|
g
|
|
g <- ggplot(data1, aes(x=mmt, y=up.fac.mean)) +
|
|
geom_point() +
|
|
aes(x=mmt, y=up.fac.mean, color=new.age)+
|
|
geom_smooth() +
|
|
xlab("MMT") +
|
|
ylab("Underproduction Factor") +
|
|
theme_bw()
|
|
g + scale_color_brewer(palette="Dark2")
|
|
g + scale_color_viridis_b()
|
|
g + scale_color_viridis_d()
|
|
g
|
|
g <- ggplot(data1, aes(x=mmt, y=up.fac.mean)) +
|
|
geom_point() +
|
|
aes(x=mmt, y=up.fac.mean, color=new.age)+
|
|
geom_smooth() +
|
|
xlab("MMT") +
|
|
ylab("Underproduction Factor") +
|
|
theme_bw()
|
|
g + scale_color_viridis_b()
|
|
g
|
|
g <- ggplot(data1, aes(x=mmt, y=up.fac.mean)) +
|
|
geom_point() +
|
|
aes(x=mmt, y=up.fac.mean, color=new.age)+
|
|
geom_smooth() +
|
|
xlab("MMT") +
|
|
ylab("Underproduction Factor") +
|
|
theme_bw()
|
|
g + scale_color_viridis_b()
|
|
g + scale_color_viridis_b() scale_fill_continuous(name = "New Legend Title")
|
|
g
|
|
g <- ggplot(data1, aes(x=mmt, y=up.fac.mean)) +
|
|
geom_point() +
|
|
aes(x=mmt, y=up.fac.mean, color=new.age)+
|
|
geom_smooth() +
|
|
xlab("MMT") +
|
|
ylab("Underproduction Factor") +
|
|
theme_bw()
|
|
g + scale_color_viridis_b() scale_fill_continuous(name = "New Legend Title")
|
|
g <- ggplot(data1, aes(x=mmt, y=up.fac.mean)) +
|
|
geom_point() +
|
|
aes(x=mmt, y=up.fac.mean, color=new.age)+
|
|
geom_smooth() +
|
|
xlab("MMT") +
|
|
ylab("Underproduction Factor") +
|
|
theme_bw()
|
|
g + scale_color_viridis_b() + scale_fill_continuous(name = "New Legend Title")
|
|
g
|
|
g <- ggplot(data1, aes(x=mmt, y=up.fac.mean)) +
|
|
geom_point() +
|
|
aes(x=mmt, y=up.fac.mean, color=new.age)+
|
|
geom_smooth() +
|
|
xlab("MMT") +
|
|
ylab("Underproduction Factor") +
|
|
theme_bw()
|
|
g + scale_color_viridis_b() + scale_fill_continuous(name = "New Legend Title")
|
|
g + scale_color_viridis_b() + scale_color_continuous(name = "New Legend Title")
|
|
g + scale_color_viridis_b() + scale_color_continuous(name = "Age Group")
|
|
g <- ggplot(data1, aes(x=mmt, y=up.fac.mean)) +
|
|
geom_point() +
|
|
aes(x=mmt, y=up.fac.mean, color=new.age)+
|
|
geom_smooth() +
|
|
xlab("MMT") +
|
|
ylab("Underproduction Factor") +
|
|
theme_bw()
|
|
g + scale_color_viridis_b() + scale_color_continuous(name = "Age Group")
|
|
g
|
|
g + scale_color_viridis_b(name = "Age Group")
|
|
g + scale_color_viridis_b(name = "Age Group", labels = c('1', '2', '3', '4'))
|
|
g <- ggplot(data1, aes(x=mmt, y=up.fac.mean)) +
|
|
geom_point() +
|
|
aes(x=mmt, y=up.fac.mean, color=new.age)+
|
|
geom_smooth() +
|
|
xlab("MMT") +
|
|
ylab("Underproduction Factor") +
|
|
theme_bw()
|
|
g + scale_color_viridis_b(name = "Age Group", labels = c('1', '2', '3', '4'))
|
|
g
|
|
g + scale_fill_viridis_b(name = "Age Group", labels = c('1', '2', '3', '4'))
|
|
g <- ggplot(data1, aes(x=mmt, y=up.fac.mean)) +
|
|
geom_point() +
|
|
aes(x=mmt, y=up.fac.mean, color=new.age)+
|
|
geom_smooth() +
|
|
xlab("MMT") +
|
|
ylab("Underproduction Factor") +
|
|
theme_bw()
|
|
g + scale_fill_viridis_b(name = "Age Group", labels = c('1', '2', '3', '4'))
|
|
g
|
|
g <- ggplot(data1, aes(x=mmt, y=up.fac.mean)) +
|
|
geom_point() +
|
|
aes(x=mmt, y=up.fac.mean, color=new.age)+
|
|
geom_smooth() +
|
|
xlab("MMT") +
|
|
ylab("Underproduction Factor") +
|
|
theme_bw()
|
|
g + scale_fill_viridis_b(name = "Age Group")
|
|
g
|
|
g + scale_fill_viridis_b(name = "Age Group")
|
|
g <- ggplot(data1, aes(x=mmt, y=up.fac.mean)) +
|
|
geom_point() +
|
|
aes(x=mmt, y=up.fac.mean, color=new.age)+
|
|
geom_smooth() +
|
|
xlab("MMT") +
|
|
ylab("Underproduction Factor") +
|
|
theme_bw()
|
|
g + scale_colour_viridis_b(name = "Age Group")
|
|
g + scale_fill_continuous(name = "Age Group")
|
|
g
|
|
g <- ggplot(data1, aes(x=mmt, y=up.fac.mean)) +
|
|
geom_point() +
|
|
aes(x=mmt, y=up.fac.mean, color=new.age)+
|
|
geom_smooth() +
|
|
xlab("MMT") +
|
|
ylab("Underproduction Factor") +
|
|
theme_bw()
|
|
g + scale_fill_continuous(name = "Age Group")
|
|
g <- ggplot(data1, aes(x=mmt, y=up.fac.mean)) +
|
|
geom_point() +
|
|
aes(x=mmt, y=up.fac.mean, color=new.age)+
|
|
geom_smooth() +
|
|
xlab("MMT") +
|
|
ylab("Underproduction Factor")
|
|
g + scale_fill_continuous(name = "Age Group")
|
|
g + scale_fill_continuous(name = "Age Group", labels=c("Woman", "Man"))
|
|
g + scale_color_continuous(name = "Age Group", labels=c("Woman", "Man"))
|
|
g
|
|
g <- ggplot(data1, aes(x=mmt, y=up.fac.mean)) +
|
|
geom_point() +
|
|
aes(x=mmt, y=up.fac.mean, color=new.age)+
|
|
geom_smooth() +
|
|
xlab("MMT") +
|
|
ylab("Underproduction Factor") +
|
|
theme_bw()
|
|
g + scale_color_continuous(name = "Age Group", labels=c("Woman", "Man"))
|
|
g
|
|
g <- ggplot(data1, aes(x=mmt, y=up.fac.mean)) +
|
|
geom_point() +
|
|
aes(x=mmt, y=up.fac.mean, color=new.age)+
|
|
geom_smooth() +
|
|
xlab("MMT") +
|
|
ylab("Underproduction Factor") +
|
|
theme_bw()
|
|
g + scale_color_continuous(type = "viridis", name = "Age Group", labels=c("Woman", "Man"))
|
|
g
|
|
g <- ggplot(data1, aes(x=mmt, y=up.fac.mean)) +
|
|
geom_point() +
|
|
aes(x=mmt, y=up.fac.mean, color=new.age)+
|
|
geom_smooth() +
|
|
xlab("MMT") +
|
|
ylab("Underproduction Factor") +
|
|
theme_bw() +
|
|
scale_color_continuous(type = "viridis", name = "Age Group")
|
|
g
|
|
g <- ggplot(data1, aes(x=mmt, y=up.fac.mean)) +
|
|
geom_point() +
|
|
aes(x=mmt, y=up.fac.mean, color=new.age)+
|
|
geom_smooth() +
|
|
xlab("MMT") +
|
|
ylab("Underproduction Factor") +
|
|
theme_bw() +
|
|
scale_color_continuous(type = "viridis", name = "Age Group", labels="0-9y", "9-12y", "12-15y", "15-17y")
|
|
g
|
|
g <- ggplot(data1, aes(x=mmt, y=up.fac.mean)) +
|
|
geom_point() +
|
|
aes(x=mmt, y=up.fac.mean, color=new.age)+
|
|
geom_smooth() +
|
|
xlab("MMT") +
|
|
ylab("Underproduction Factor") +
|
|
theme_bw() +
|
|
scale_color_continuous(type = "viridis", name = "Age Group", labels=c("0-9y", "9-12y", "12-15y", "15-17y"))
|
|
g
|
|
+ theme(legend.position = c(0.8, 0.2))
|
|
g
|
|
g <- ggplot(data1, aes(x=mmt, y=up.fac.mean)) +
|
|
geom_point() +
|
|
aes(x=mmt, y=up.fac.mean, color=new.age)+
|
|
geom_smooth() +
|
|
xlab("MMT") +
|
|
ylab("Underproduction Factor") +
|
|
theme_bw() +
|
|
scale_color_continuous(type = "viridis", name = "Age Group", labels=c("0-9y", "9-12y", "12-15y", "15-17y")) +
|
|
theme(legend.position = c(0.8, 0.2))
|
|
g
|
|
g <- ggplot(data1, aes(x=mmt, y=up.fac.mean)) +
|
|
geom_point() +
|
|
aes(x=mmt, y=up.fac.mean, color=new.age)+
|
|
geom_smooth() +
|
|
xlab("MMT") +
|
|
ylab("Underproduction Factor") +
|
|
theme_bw() +
|
|
scale_color_continuous(type = "viridis", name = "Age Group", labels=c("0-9y", "9-12y", "12-15y", "15-17y")) +
|
|
theme(legend.position = c(0.1, 0.1))
|
|
g
|
|
g <- ggplot(data1, aes(x=mmt, y=up.fac.mean)) +
|
|
geom_point() +
|
|
aes(x=mmt, y=up.fac.mean, color=new.age)+
|
|
geom_smooth() +
|
|
xlab("MMT") +
|
|
ylab("Underproduction Factor") +
|
|
theme_bw() +
|
|
scale_color_continuous(type = "viridis", name = "Age Group", labels=c("0-9y", "9-12y", "12-15y", "15-17y")) +
|
|
theme(legend.position = c(0.1, 0.2))
|
|
g
|
|
summary(mmtmodel1)
|
|
g <- ggplot(data1, aes(x=mmt, y=up.fac.mean)) +
|
|
geom_point() +
|
|
aes(x=mmt, y=up.fac.mean, color=as.factor(new.age))+
|
|
geom_smooth() +
|
|
xlab("MMT") +
|
|
ylab("Underproduction Factor") +
|
|
theme_bw() +
|
|
scale_color_continuous(type = "viridis", name = "Age Group", labels=c("0-9y", "9-12y", "12-15y", "15-17y")) +
|
|
theme(legend.position = c(0.1, 0.2))
|
|
g
|
|
g <- ggplot(data1, aes(x=mmt, y=up.fac.mean)) +
|
|
geom_point() +
|
|
aes(x=mmt, y=up.fac.mean, color=as.factor(new.age))+
|
|
geom_smooth() +
|
|
xlab("MMT") +
|
|
ylab("Underproduction Factor") +
|
|
theme_bw() +
|
|
scale_color_discrete(type = "viridis", name = "Age Group", labels=c("0-9y", "9-12y", "12-15y", "15-17y")) +
|
|
theme(legend.position = c(0.1, 0.2))
|
|
g
|
|
g <- ggplot(data1, aes(x=mmt, y=up.fac.mean)) +
|
|
geom_point() +
|
|
aes(x=mmt, y=up.fac.mean, color=new.age)+
|
|
geom_smooth() +
|
|
xlab("MMT") +
|
|
ylab("Underproduction Factor") +
|
|
theme_bw() +
|
|
scale_color_identity(type = "viridis", name = "Age Group", labels=c("0-9y", "9-12y", "12-15y", "15-17y")) +
|
|
theme(legend.position = c(0.1, 0.2))
|
|
g
|
|
g <- ggplot(data1, aes(x=mmt, y=up.fac.mean)) +
|
|
geom_point() +
|
|
aes(x=mmt, y=up.fac.mean, color=new.age)+
|
|
geom_smooth() +
|
|
xlab("MMT") +
|
|
ylab("Underproduction Factor") +
|
|
theme_bw() +
|
|
scale_color_identity(type = "viridis", name = "Age Group", labels=c("0-9y", "9-12y", "12-15y", "15-17y")) +
|
|
theme(legend.position = c(0.1, 0.2))
|
|
g
|
|
g <- ggplot(data1, aes(x=mmt, y=up.fac.mean)) +
|
|
geom_point() +
|
|
aes(x=mmt, y=up.fac.mean, color=round(new.age))+
|
|
geom_smooth() +
|
|
xlab("MMT") +
|
|
ylab("Underproduction Factor") +
|
|
theme_bw() +
|
|
scale_color_identity(type = "viridis", name = "Age Group", labels=c("0-9y", "9-12y", "12-15y", "15-17y")) +
|
|
theme(legend.position = c(0.1, 0.2))
|
|
g
|
|
g <- ggplot(data1, aes(x=mmt, y=up.fac.mean)) +
|
|
geom_point() +
|
|
geom_smooth() +
|
|
xlab("MMT") +
|
|
ylab("Underproduction Factor") +
|
|
theme_bw()
|
|
g
|