Package 'FertNet'

Title: Process Data from the Social Networks and Fertility Survey
Description: Processes data from The Social Networks and Fertility Survey, downloaded from <https://dataarchive.lissdata.nl>, including correcting respondent errors and transforming network data into network objects to facilitate analyses and visualisation.
Authors: Gert Stulp [aut, cre]
Maintainer: Gert Stulp <[email protected]>
License: CC BY 4.0
Version: 0.1.2
Built: 2024-11-02 04:12:11 UTC
Source: https://github.com/gertstulp/fertnet

Help Index


Change column types for social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Description

Change column types for social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Usage

change_column_types(data)

Arguments

data

Tibble which is the result of translate(read_data())

Value

Tibble with corrected column types and updated labels

Examples

read_data() |> translate() |> change_column_types()

Create dataframe of alter attributes based on social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Description

Create dataframe of alter attributes based on social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Usage

create_alter_attr(data)

Arguments

data

Tibble which is the result of create_relation_labels(fix_errors(change_column_types(translate(read_data()))))

Value

Tibble with variable alter_attr which includes a dataframe with alter attributes for each respondent

Examples

data <- read_data() |> translate() |>
change_column_types() |> fix_errors() |> create_relation_labels()
create_alter_attr(data[1, ])

Create dataframe of edgelist based on social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Description

Create dataframe of edgelist based on social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Usage

create_edgelist(data = NULL, vars = NULL)

Arguments

data

Tibble which is the result of create_relation_labels(fix_errors(change_column_types(translate(read_data()))))

vars

Vector with variable names of 25 variables describing alter-alter-ties

Value

Tibble with variable edgelist which includes a dataframe with edgelist for each respondent

Examples

data <- read_data() |> translate() |> change_column_types() |>
fix_errors() |> create_relation_labels()
create_edgelist(data[1, vars_alter_ties])

Create dataframes of alter attributes and edgelists and store them in list-columns for social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Description

Create dataframes of alter attributes and edgelists and store them in list-columns for social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Usage

create_nw(data)

Arguments

data

Tibble which is the result of create_relation_labels(fix_errors(change_column_types(translate(read_data()))))

Value

Tibble with list-columns containing alter attributes and edgelists

Examples

read_data() |> translate() |> change_column_types() |>
fix_errors() |> create_relation_labels() |> create_nw()

Produces corrected relationship labels for social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Description

Produces corrected relationship labels for social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Usage

create_relation_labels(data)

Arguments

data

Tibble which is the result of fix_errors(change_column_types(translate(read_data())))

Value

Tibble in which data on relationship labels are corrected and improved

Examples

read_data() |> translate() |> change_column_types() |>
fix_errors() |> create_relation_labels()

Create tidygraph objects from social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Description

Create tidygraph objects from social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Usage

create_tidygraph(data)

Arguments

data

Tibble which is the result of produce_data()

Value

Tibble with variable tidygraph that includes tidygraph objects for all respondents

Examples

produce_data() |> create_tidygraph()

Fixes reporting errors and inconsistencies in social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Description

Fixes reporting errors and inconsistencies in social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Usage

fix_errors(data)

Arguments

data

Tibble which is the result of ⁠change_column_types(translate(read_data())⁠

Value

Tibble in which data errors are fixed and data worries are flagged

Examples

read_data() |> translate() |> change_column_types() |> fix_errors()

Get respondent background variables (LISS: avars_201802_EN_1.0p.sav) for social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Description

Get respondent background variables (LISS: avars_201802_EN_1.0p.sav) for social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Usage

get_background_vars(file = "avars_201802_EN_1.0p.sav")

Arguments

file

Path to file avars_201802_EN_1.0p.sav (or renamed variant)

Value

Tibble of data with background variables for social networks and fertility data

Examples

get_background_vars()

Produces tidy dataset of social networks and fertility data (LISS: wj18a_EN_1.0p.sav) with network data as listcolumns

Description

Produces tidy dataset of social networks and fertility data (LISS: wj18a_EN_1.0p.sav) with network data as listcolumns

Usage

produce_data(
  tidygraph_col = FALSE,
  background_vars = FALSE,
  remove_timing_vars = TRUE
)

Arguments

tidygraph_col

Should a variable tidygraph be created that includes tidygraph object for each respondent? (default: FALSE)

background_vars

Should respondent background variables be added? Requires presence of avars_201802_EN_1.0p.sav (default: FALSE)

remove_timing_vars

Should variables on timing of survey responses be removed? (default: TRUE)

Value

Tibble of social networks and fertility data (LISS: wj18a_EN_1.0p.sav) with network data as listcolumns

Examples

produce_data()
produce_data(TRUE, TRUE, FALSE)

Reads-in social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Description

Reads-in social networks and fertility data (LISS: wj18a_EN_1.0p.sav)

Usage

read_data(file = "wj18a_EN_1.0p.sav")

Arguments

file

Path to file wj18a_EN_1.0p.sav (or renamed variant)

Value

Tibble of social networks and fertility data

Examples

read_data("wj18a_EN_1.0p.sav")

Remove variables related to timing of giving answers in survey

Description

Remove variables related to timing of giving answers in survey

Usage

remove_timing_vars(data)

Arguments

data

Tibble sent within function produce_data()

Value

Tibble without timing variables


Translate LISS variable names of social networks and fertility data (LISS: wj18a_EN_1.0p.sav) into sensible English names

Description

Translate LISS variable names of social networks and fertility data (LISS: wj18a_EN_1.0p.sav) into sensible English names

Usage

translate(data)

Arguments

data

Tibble which is the result of read_data()

Value

Tibble with sensible column names

Examples

read_data() |> translate()