Title: | Handling Incomplete Responses in Survey Data Analysis |
---|---|
Description: | Offers robust tools to identify and manage incomplete responses in survey datasets, thereby enhancing the quality and reliability of research findings. |
Authors: | Hendrik Mann [aut, cre] |
Maintainer: | Hendrik Mann <[email protected]> |
License: | MIT + file LICENSE |
Version: | 2.2.1 |
Built: | 2025-02-12 04:10:30 UTC |
Source: | https://github.com/hendr1km/dropout |
The drop_detect
function detects participants who drop out of the survey by recognizing NA sequences up to the last question of the survey. Additionally, the function provides the column name and index where the dropout occurs.
drop_detect(data)
drop_detect(data)
data |
A dataframe in which to detect instances of dropout. |
A dataframe containing the following columns:
drop: A logical value indicating whether dropout has occurred (TRUE
for dropout, FALSE
otherwise).
drop_index: The index of the column where dropout occurred (NA
if no dropout).
column: The name of the column where the dropout occurred (<NA>
if no dropout).
## Not run: # Example usage with the 'flying' dataframe detect_result <- drop_detect(flying) print(detect_result) ## End(Not run)
## Not run: # Example usage with the 'flying' dataframe detect_result <- drop_detect(flying) print(detect_result) ## End(Not run)
The drop_summary
function generates a summary of missing data (NA values) for each column in a dataframe.
It computes various metrics such as the number of dropout participants, section NAs, the mode length of those missing value sections for, and the proportion of complete cases for each column.
drop_summary(data)
drop_summary(data)
data |
A dataframe for which to analyze missing data. |
The function calls a C API to compute some metrics, which are then processed and returned as a summary dataframe.
A dataframe containing the following columns:
column: The name of each column in the input dataframe.
drop: The number of dropped rows (missing values) for that column.
sec_na: The number of sections of consecutive NAs for that column.
sec_length: The mode (most frequent length) of sections of consecutive NAs for that column.
single_na: The number of single NA values (isolated missing values) for that column.
na: The total number of missing (NA) values for that column.
complete: The proportion of complete rows for that column, where a value of 1 means no missing data, and values closer to 0 mean more missing data.
## Not run: # Example usage with the 'flying' dataframe summary_result <- drop_summary(flying) print(summary_result) ## End(Not run)
## Not run: # Example usage with the 'flying' dataframe summary_result <- drop_summary(flying) print(summary_result) ## End(Not run)
This is a modified version of the Flying Etiquette Survey data behind the story: 41 percent of flyers say it's rude to recline your seat on an airplane.
flying
flying
a dataframe 1040 obs. and 28 columns, which are:
respondentid
how often do you travel by plane?
do you ever recline your seat when you fly?
how tall are you?
do you have any children under 18?
in a row of three seats, who should get to use the two arm rests?
in a row of two seats, who should get to use the middle arm rest?
who should have control over the window shade?
is it rude to move to an unsold seat on a plane?
generally speaking, is it rude to say more than a few words to the stranger sitting next to you on a plane?
on a 6 hour flight from nyc to la, how many times is it acceptable to get up if you're not in an aisle seat?
is it rude to recline your seat on a plane?
given the opportunity, would you eliminate the possibility of reclining seats on planes entirely?
is it rude to ask someone to switch seats with you in order to be closer to friends?
is it rude to ask someone to switch seats with you in order to be closer to family?
is it rude to wake a passenger up if you are trying to go to the bathroom?
is it rude to wake a passenger up if you are trying to walk around?
in general, is it rude to bring a baby on a plane?
in general, is it rude to knowingly bring unruly children on a plane?
have you ever used personal electronics during take off or landing in violation of a flight attendant's direction?
have you ever smoked a cigarette in an airplane bathroom when it was against the rules?
gender
age
household income
education
location (census region)
type of the survey
https://github.com/fivethirtyeight/data/tree/15f210532b2a642e85738ddefa7a2945d47e2585/flying-etiquette-survey
https://fivethirtyeight.com/features/airplane-etiquette-recline-seat/
data(flying)
data(flying)