var.apc.plot.fit {apc} | R Documentation |
apc.plot.fit
This command works in exactly the same way as the pre-existing command apc.plot.fit
,
but allows more control over aspects of the presentation. For example, the Y-axis labels are
displayed horizontally rather than vertically.
var.apc.plot.fit(apc.fit.model, scale = FALSE, sdv.at.zero = TRUE, type = "detrend", sub.plot = NULL, main.outer = NULL, main.sub = NULL, cex = NULL, cex.axis = NULL, cex.main = 2, mgp = c(2, 1, 0), theight = 1, mar = c(4, 3, 2, 0), oma = c(0, 0, 5, 1))
apc.fit.model |
List. See |
scale |
Optional. Logical. If (TRUE) FALSE use scale of (inverse) link function. Default is FALSE. |
sdv.at.zero |
Optional. Logical. If FALSE/TRUE standard deviations are plotted around estimates/zero. Default is TRUE. |
type |
Optional. Character. If "detrend" double sums start and end in zero. If "sum.sum" double sums anchored as discussed in Nielsen (2014b). Default is "detrend". |
sub.plot |
Optional. Character: "a","b",...,"i". Only the indicated sub plot is plotted. Default is NULL so all plots shown. |
main.outer |
Optional. Character. Main title in outer margin. Default is generated internally. |
main.sub |
Optional. Vector of 9 characters. Main titles for individual plots. Default is generated internally, see note 3 below. |
cex |
Optional. Plot parameter, see |
cex.axis |
Optional. Plot parameter, see |
cex.main |
Optional. Plot parameter, see |
mgp |
Optional. Plot parameter, see |
theight |
Optional. Plot parameter, see |
mar |
Optional. Plot parameter, see |
oma |
Optional. Plot parameter, see |
This command makes some minor adjustments to pre-existing apc.plot.fit
, for example changing the default relative sizes of titles and orientation of the axes. It also brings more underlying par
plot elements to the command line, allowing the user to exercise greater control over the appearance of the plots.
Zoe Fannon <zoe.fannon@economics.ox.ac.uk> 13 Jul 2018
Fannon, Z. (2018) apc.indiv
: R tools to estimate age-period-cohort models with repeated cross section data. Mimeo. University of Oxford.
Fannon, Z., Monden, C. and Nielsen, B. (2018) Age-period-cohort modelling and covariates, with an application to obesity in England 2001-2014. Mimeo. University of Oxford.
The example below uses data from the NHIS,
see data.NHIS.sample
data("data.NHIS.sample") ## Get appropriate data # Period-cohort PC_sub <- data.NHIS.sample[data.NHIS.sample$cohort>=1961 & data.NHIS.sample$cohort<=1968 & data.NHIS.sample$period>=2008,] # Estimate a model M3 <- apc.indiv.est.model(PC_sub, dep.var = "Lbmi", covariates = c("daysbed", "nowsmoke", "eversmoke"), model.family = "gaussian") # Default plotting behaviour var.apc.plot.fit(M3)