# No concurrency model
no.conc <- conc.microsim(
s.num.f = 1000,
i.num.f = 50,
s.num.m = 1000,
i.num.m = 50,
monog.f = TRUE,
monog.m = TRUE,
meandeg = 0.8,
part.duration = 10,
nsteps = 2000,
nsims = 10,
verbose = TRUE)
# Male concurrency only model
male.conc <- conc.microsim(
s.num.f = 1000,
i.num.f = 50,
s.num.m = 1000,
i.num.m = 50,
monog.f = TRUE,
monog.m = FALSE,
meandeg = 0.8,
part.duration = 10,
nsteps = 2000,
nsims = 10,
verbose = TRUE)
# Female concurrency only model
feml.conc <- conc.microsim(
s.num.f = 1000,
i.num.f = 50,
s.num.m = 1000,
i.num.m = 50,
monog.f = FALSE,
monog.m = TRUE,
meandeg = 0.8,
part.duration = 10,
nsteps = 2000,
nsims = 10,
verbose = TRUE)
# Both sexes concurrency model
both.conc <- conc.microsim(
s.num.f = 1000,
i.num.f = 50,
s.num.m = 1000,
i.num.m = 50,
monog.f = FALSE,
monog.m = FALSE,
meandeg = 0.8,
part.duration = 10,
nsteps = 2000,
nsims = 10,
verbose = TRUE)
# Plot the results
par(mfrow=c(2,2), mar=c(3,3,3,1), mgp=c(2,1,0))
plot(no.conc, alpha=0.5, ylim=c(0, 0.5), main="No Concurrency")
plot(male.conc, alpha=0.5, ylim=c(0, 0.5), main="Male Concurrency")
plot(feml.conc, alpha=0.5, ylim=c(0, 0.5), main="Female Concurrency")
plot(both.conc, alpha=0.5, ylim=c(0, 0.5), main="Both Concurrency")
Run the code above in your browser using DataLab