diff options
| author | Ben Green <bgreen@g.harvard.edu> | 2015-08-01 12:01:19 -0400 |
|---|---|---|
| committer | Ben Green <bgreen@g.harvard.edu> | 2015-08-01 12:01:19 -0400 |
| commit | 9350ee2c6359562a23cf8efdefdd7de80b2a682e (patch) | |
| tree | b1217fcc2098bebaa6fed641bb759ac71eae139f /R Scripts/predict-victims-plots.R | |
| parent | 37c23e0d1fcbdee116856d59c0dab98686e265ae (diff) | |
| download | criminal_cascades-9350ee2c6359562a23cf8efdefdd7de80b2a682e.tar.gz | |
minor updates
Diffstat (limited to 'R Scripts/predict-victims-plots.R')
| -rw-r--r-- | R Scripts/predict-victims-plots.R | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/R Scripts/predict-victims-plots.R b/R Scripts/predict-victims-plots.R index 553aa89..b872201 100644 --- a/R Scripts/predict-victims-plots.R +++ b/R Scripts/predict-victims-plots.R @@ -1,5 +1,5 @@ ##### Plot results -hist(correct_rank1,150,xlim=c(0,vcount(lcc)),col=rgb(0,0,1,1/8), +hist(correct_rank2,150,xlim=c(0,vcount(lcc)),col=rgb(0,0,1,1/8), xlab='Risk Ranking of Victims',main='') hist(correct_rank1,150,xlim=c(0,vcount(lcc)),col=rgb(1,0,1,1/8),add=T) hist(correct_rank2,150,xlim=c(0,vcount(lcc)),col=rgb(0,0,1,1/8),add=T) @@ -15,7 +15,7 @@ plot(lambdas,counts[1,],log='x',type='l') correct_rank1 = correct_rank[,length(lambdas)] # demographics model correct_rank2 = correct_rank[,1] # cascade model correct_rank3 = correct_rank[,which.min(colMeans(correct_rank))] # best combined model -counts = matrix(c(sum(correct_rank1<(vcount(lcc)*0.001)), +counts = matrix(c( sum(correct_rank1<(vcount(lcc)*0.001)), sum(correct_rank1<(vcount(lcc)*0.005)), sum(correct_rank1<(vcount(lcc)*0.01)), sum(correct_rank2<(vcount(lcc)*0.001)), @@ -33,7 +33,7 @@ barplot(counts, col=c(rgb(0,0,1,1/2),rgb(1,0,0,1/2),rgb(0,1,0,1/2)), beside=TRUE) legend("topleft", inset=0.05, - c("Demographics Model", "Cascade Model", "Combined Model"), + c("Demographics (Logit)", "Cascades (Sum parent)", "Combined Model"), fill=c(rgb(0,0,1,1/2),rgb(1,0,0,1/2),rgb(0,1,0,1/2))) box(which='plot') |
