Skip to content

Commit

Permalink
Merge pull request #26 from mccarthy-m-g/chapter-10
Browse files Browse the repository at this point in the history
Update Chapter 10
  • Loading branch information
mccarthy-m-g authored May 27, 2024
2 parents d04cb7a + 7a59c5b commit 7ac8939
Show file tree
Hide file tree
Showing 12 changed files with 339 additions and 111 deletions.
10 changes: 5 additions & 5 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ NULL

#' Weeks to cocaine relapse after treatment
#'
#' A subset of data from Hall, Havassy, and Wasserman's (1990) measuring the
#' A subset of data from Hall, Havassy, and Wasserman (1990) measuring the
#' number of weeks of relapse to cocaine use in a sample of 104 former addicts
#' released from an in-patient treatment program. In-patients were followed for
#' up to 12 weeks or until they used cocaine for 7 consecutive days.
Expand All @@ -415,7 +415,7 @@ NULL

#' Age of first sexual intercourse
#'
#' A subset of data from Capaldi, Crosby, and Stoolmiller's (1996) measuring the
#' A subset of data from Capaldi, Crosby, and Stoolmiller (1996) measuring the
#' grade year of first sexual intercourse in a sample of 180 at-risk
#' heterosexual adolescent males. Adolescent males were followed from Grade 7 up
#' to Grade 12 or until they reported having had sexual intercourse for the
Expand Down Expand Up @@ -457,9 +457,9 @@ NULL
#'
#' \describe{
#' \item{`id`}{Participant ID.}
#' \item{`time`}{Reported age of first suicide ideation.}
#' \item{`age`}{Reported age of first suicide ideation.}
#' \item{`censor`}{Censoring status.}
#' \item{`age`}{Participant age at the time of the survey.}
#' \item{`age_now`}{Participant age at the time of the survey.}
#' }
#' @source
#' Bolger, N., Downey, G., Walker, E., & Steininger, P. (1989). The onset of
Expand All @@ -480,7 +480,7 @@ NULL
#' \describe{
#' \item{`id`}{Participant ID.}
#' \item{`name`}{Representative name.}
#' \item{`time`}{Number of terms in office.}
#' \item{`terms`}{Number of terms in office.}
#' \item{`censor`}{Censoring status.}
#' \item{`democrat`}{Party affiliation.}
#' }
Expand Down
5 changes: 3 additions & 2 deletions data-raw/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,11 @@ first_sex <- tidy_data$firstsex |>
parental_antisociality = pas
)

suicide_ideation <- tidy_data$suicide_orig
suicide_ideation <- tidy_data$suicide_orig |>
rename(age_now = age, age = time)

congresswomen <- tidy_data$congress_orig |>
rename(democrat = dem)
rename(terms = time, democrat = dem)

# Chapter 11 ------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion data-raw/data/tidy/congresswomen.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
id,name,time,censor,democrat
id,name,terms,censor,democrat
1,"Abzug, Bella",3,0,1
2,"Andrews, Elizabeth",1,0,1
3,"Ashbrook, Jean",1,0,0
Expand Down
2 changes: 1 addition & 1 deletion data-raw/data/tidy/suicide_ideation.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
id,time,censor,age
id,age,censor,age_now
1,16,0,18
2,10,0,19
3,16,0,19
Expand Down
Binary file modified data/congresswomen.rda
Binary file not shown.
Binary file modified data/suicide_ideation.rda
Binary file not shown.
2 changes: 1 addition & 1 deletion man/cocaine_relapse_1.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/congresswomen.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/first_sex.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/suicide_ideation.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7ac8939

Please sign in to comment.