Title: | Group-Based Modelling of Longitudinal Data |
---|---|
Description: | A finite mixture of Zero-Inflated Poisson (ZIP) models for analyzing criminal trajectories. |
Authors: | Jason D. Nielsen <[email protected]> |
Maintainer: | Jason D. Nielsen <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.0.0 |
Built: | 2024-12-01 08:49:42 UTC |
Source: | CRAN |
This software fits finite mixtures of ZIP models to longitudinal count data.
crimCV(Dat,ng,dpolyp=3,dpolyl=3,model="ZIPt",rcv=FALSE,init=20,Risk=NULL)
crimCV(Dat,ng,dpolyp=3,dpolyl=3,model="ZIPt",rcv=FALSE,init=20,Risk=NULL)
Dat |
A matrix of the number of criminal offenses. Each row contains the number of criminal offenses committed by a particular individual for all time intervals observed (columns). A negative number is interpreted as a missing value. |
ng |
The number of groups to use in the analysis. |
dpolyp |
The degree of the polynomial in the log-linear component. Defaults to 3. |
dpolyl |
The degree of the polynomial in the logistic component (ZIP model only). Defaults to 3. |
model |
Either "ZIP" for the full ZIP or "ZIPt" for the ZIP(tau) sub-group model. Defaults to "ZIPt". |
rcv |
Set to TRUE to compute the CVE. Defaults to FALSE. |
init |
This controls how rigorously the initialization procedure searches for good starting values of the parameters. Larger values increase the odds of finding the true global solution but can dramatically increase the time required to fit the model. The default is set to 20 and from experimentation this seems to be a reasonable value for ng<=5. Note: As the number of groups (ng) gets larger finding the optimal global maximum of the likelihood becomes progressively more challenging. |
Risk |
A matrix of the same dimension as Dat with the time-at-risk correction. Defaults to 1 for all elements (i.e. at risk for the full time period). |
A list of class "dmZIP" or "dmZIPt".
Jason D. Nielsen
J.D. Nielsen, J.S. Rosenthal, Y. Sun, D.M. Day, I. Bevc, and T. Duchesne (2011). Group-based Criminal Trajectory Analysis using Cross-Validation Criteria. A draft of the manuscript is available at http://www.probability.ca/jeff/research.html.
# Loads crimCV into the interpreter library(crimCV) # Load the "divide-and-round" TO1 dataset data(TO1adj) # Fit a 2 component ZIP(tau) model of degree 2. Here the CVE is not # calculated and only ~1/4 of the data is used so that the code will # run quickly enough to satisfy CRAN's package policies. To compute # CVE run as: # out1<-crimCV(TO1adj,2,dpolyp=2,rcv=TRUE) subTO1adj<-TO1adj[1:100,] out1<-crimCV(subTO1adj,2,dpolyp=2,init=5) # Plot the component trajectories plot(out1) # Print out some useful output summary(out1)
# Loads crimCV into the interpreter library(crimCV) # Load the "divide-and-round" TO1 dataset data(TO1adj) # Fit a 2 component ZIP(tau) model of degree 2. Here the CVE is not # calculated and only ~1/4 of the data is used so that the code will # run quickly enough to satisfy CRAN's package policies. To compute # CVE run as: # out1<-crimCV(TO1adj,2,dpolyp=2,rcv=TRUE) subTO1adj<-TO1adj[1:100,] out1<-crimCV(subTO1adj,2,dpolyp=2,init=5) # Plot the component trajectories plot(out1) # Print out some useful output summary(out1)
Number of criminal unique court contacts for 378 individuals in Toronto, Ontario, Canada.
data(TO1)
data(TO1)
A 378 by 31 matrix where each row contains the number of unique court contacts per year for an individual from the age of 8 to 38.
Number of unique court contacts for 378 individuals in Toronto, Ontario, Canada adjusted for time-at-risk by the "divide and round" approach.
data(TO1adj)
data(TO1adj)
A 378 by 31 matrix where each row contains the number of unique court contacts per year corrected for time-at-risk for an individual from the age of 8 to 38.
Time-at-risk per year for 378 individuals in the Toronto, Ontario, Canada.
data(TO1Risk)
data(TO1Risk)
A 378 by 31 matrix where each row contains the time-at-risk per year for an individual from the age of 8 to 38.
Number of unique court contacts for 386 individuals in Toronto, Ontario, Canada.
data(TO2)
data(TO2)
A 386 by 30 matrix where each row contains the number of unique court contacts per year for an individual from the age of 9 to 38.
Number of unique court contacts for 386 individuals in Toronto, Ontario, Canada adjusted for time-at-risk by the "divide and round" approach.
data(TO2adj)
data(TO2adj)
A 386 by 30 matrix where each row contains the number of unique court contacts per year corrected for time-at-risk for an individual from the age of 9 to 38.
Time-at-risk for 386 individuals in the Toronto, Ontario, Canada.
data(TO2Risk)
data(TO2Risk)
A 386 by 30 matrix where each row contains the number of criminal offenses per year for an individual from the age of 9 to 38.