Skip to content
Snippets Groups Projects
Commit 0a92ba26 authored by Walmes Marques Zeviani's avatar Walmes Marques Zeviani
Browse files

Modifies the documentation of the ahs data set

- Replace chcond1 and chcond2 for chcond, a factor with 3 levels.
- Remove the variable id.
- Code sex as factor with male and femae levels.
- Minor changes in the description of each variable.
parent 90df9e77
Branches
No related tags found
No related merge requests found
...@@ -33,41 +33,40 @@ NULL ...@@ -33,41 +33,40 @@ NULL
#' #'
#' \itemize{ #' \itemize{
#' #'
#' \item \code{sex} - Factor, two levels (0-Male; 1-Female). #' \item \code{sex} - Factor with levels \code{male} and \code{female}.
#' #'
#' \item \code{age} - Respondent's age in years divided by 100. #' \item \code{age} - Respondent's age in years divided by 100.
#' #'
#' \item \code{income} - Respondent's annual income in Australian #' \item \code{income} - Respondent's annual income in Australian
#' dollars divided by 1000. #' dollars divided by 1000.
#' #'
#' \item \code{levyplus} - Factor, two levels (1- if respondent is #' \item \code{levyplus} - Coded factor. If respondent is covered by
#' covered by private health insurance fund for private patients in #' private health insurance fund for private patients in public
#' public hospital (with doctor of choice); 0 - otherwise). #' hospital with doctor of choice (1) or otherwise (0).
#' #'
#' \item \code{freepoor} - Factor, two levels (1 - if respondent is #' \item \code{freepoor} - Coded factor. If respondent is covered by
#' covered by government because low income, recent immigrant, #' government because low income, recent immigrant, unemployed (1)
#' unemployed; 0 - otherwise). #' or otherwise (0).
#' #'
#' \item \code{freerepa} - Factor, two levels (1 - if respondent is #' \item \code{freerepa} - Coded factor. If respondent is covered free
#' covered free by government because of old-age or disability #' by government because of old-age or disability pension, or
#' pension, or because invalid veteran or family of deceased #' because invalid veteran or family of deceased veteran (1) or
#' veteran; 0 - otherwise). #' otherwise (0).
#' #'
#' \item \code{illnes} - Number of illnesses in past 2 weeks, with 5 or #' \item \code{illnes} - Number of illnesses in past 2 weeks, with 5 or
#' more weeks coded as 5. #' illnesses coded as 5.
#' #'
#' \item \code{actdays} - Number of days of reduced activity in the past #' \item \code{actdays} - Number of days of reduced activity in the past
#' two weeks due to illness or injury. #' two weeks due to illness or injury.
#' #'
#' \item \code{hscore} - Respondent's general health questionnaire score #' \item \code{hscore} - Respondent's general health questionnaire score
#' using Goldberg's method; high score indicates poor health. #' using Goldberg's method. High score indicates poor health.
#' #'
#' \item \code{chcond1} - Factor, two levels (1 - if respondent has #' \item \code{chcond} - Factor with three levels. If respondent has
#' chronic condition(s) but is not limited in activity; 0 - #' chronic condition(s) and is limited in activity (\code{limited}),
#' otherwise). #' or if the respondent has chronic condition(s) but is not limited
#' #' in activity (\code{nonlimited}) or otherwise (\code{otherwise},
#' \item \code{chcond2} - Factor, two levels (1 if respondent has #' reference level).
#' chronic condition(s) and is limited in activity; 0 - otherwise).
#' #'
#' \item \code{Ndoc} - Number of consultations with a doctor or #' \item \code{Ndoc} - Number of consultations with a doctor or
#' specialist (response variable). #' specialist (response variable).
...@@ -85,8 +84,6 @@ NULL ...@@ -85,8 +84,6 @@ NULL
#' \item \code{Nmed} - Total number of prescribed and non prescribed #' \item \code{Nmed} - Total number of prescribed and non prescribed
#' medications used in the past two days. #' medications used in the past two days.
#' #'
#' \item \code{id} - Respondent's index.
#'
#' } #' }
#' #'
#' @docType data #' @docType data
...@@ -101,4 +98,42 @@ NULL ...@@ -101,4 +98,42 @@ NULL
#' the elderly: A finite mixture approach, Journal of Applied #' the elderly: A finite mixture approach, Journal of Applied
#' Econometrics 12(3):313--336. #' Econometrics 12(3):313--336.
#' #'
#' @examples
#'
#' library(lattice)
#' library(latticeExtra)
#'
#' data(ahs, package="mcglm")
#' str(ahs)
#'
#' xt <- xtabs(~age+sex, data=ahs)
#' mosaicplot(xt)
#'
#' xt <- xtabs(~age+chcond, data=ahs)
#' mosaicplot(xt)
#'
#' useOuterStrips(
#' combineLimits(
#' xyplot(Ndoc+Nndoc+Nadm+Nhosp+Nmed~age|sex,
#' outer=TRUE, data=ahs,
#' jitter.x=TRUE, amount=0.01,
#' type=c("p", "a"),
#' scales=list(y=list(relation="free")),
#' ylab="Number or occurences",
#' xlab="Age (years/100)")
#' )
#' )
#'
#' useOuterStrips(
#' combineLimits(
#' xyplot(Ndoc+Nndoc+Nadm+Nhosp+Nmed~income|sex,
#' outer=TRUE, data=ahs,
#' jitter.x=TRUE, amount=0.01,
#' type=c("p", "a"),
#' scales=list(y=list(relation="free")),
#' ylab="Number or occurences",
#' xlab="Age (years/100)")
#' )
#' )
#'
NULL NULL
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment