## Warning: Likelihood approximated using only a limited number
## of Monte Carlo replications.
## Polio data.
## Marginal negative binomial model with ARMA(2,1) correlation matrix.
data( polio )
names( polio )
gcmr( y ~ . , data = polio, marginal = negbin.marg, cormat = arma.cormat( 2, 1 ),
options = list( seed = 71271, nrep = 100 ) )
## Scotland lip cancer data.
## Marginal negative binomial model with Matern correlation matrix.
data(scotland)
D.scotland <- spDists( cbind( scotland$longitude, scotland$latitude ), longlat = TRUE )
gcmr( observed ~ offset( log( expected ) ) + AFF + I( latitude / 100 ), data = scotland,
marginal = negbin.marg, cormat = matern.cormat( D.scotland ), options =
list( seed = 71271, nrep = 100 ) )
## Monthly Deaths from Lung Diseases in the UK.
## Marginal Gamma model with ARMA(1,0) correlation matrix
sinTerm <- sin( 2*pi*time( ldeaths ) )
cosTerm <- cos( 2*pi*time( ldeaths ) )
trend <- scale( time( ldeaths ) )
gcmr( ldeaths ~ trend + sinTerm + cosTerm, marginal = Gamma.marg( link = "log" ),
cormat = arma.cormat( p = 1 ) )
## now with dispersion modelling
gcmr( ldeaths ~ trend + sinTerm + cosTerm | trend + sinTerm + cosTerm, marginal =
Gamma.marg( link = "log" ), cormat = arma.cormat( p = 1 ) )
## Prater's Petrol Refinery Data
## Beta regression with exchangeable within clustered correlation
gcmr( I( Y/100 ) ~ SG + VP + V10 + EP, marginal = beta.marg, cormat = cluster.cormat(
id = as.numeric(No), type = "exchangeable" ), data = petrol )
## (results suggest no evidence of within-cluster correlation)Run the code above in your browser using DataLab