This function generates a data frame that contains participant-level information. Each row is a given participant's response and each column is a variable. The same participant will always be identified with the same id. The variable time indexes how many times a participant has been sent the questionnaire, independently of whether a response was obtained from them later.

ml_logs(
  participants = NULL,
  responses = NULL,
  bilingual_threshold = 0.8,
  other_threshold = 0.1
)

Arguments

participants

Participants data frame, as generated by ml_participants. If NULL (default), ml_participants is run.

responses

Responses data frame, as generated by ml_responses. If NULL (default), ml_responses is run.

bilingual_threshold

Numeric scalar ranging from 0 to 1 indicating the minimum degree of exposure to Catalan or Spanish to consider a participant as *Monolingual*.

other_threshold

Numeric scalar ranging from 0 to 1 indicating the minimum degree of exposure to languages other than Catalan and Spanish to consider a participant as *Other*.

Value

A data frame (actually, a tibble) with participant-level information. Each row corresponds to a questionnaire response and each column represents a variable. The output includes the following variables:

id

a character string indicating a participant's identifier. This value is always the same for each participant, so that different responses from the same participant share the same id.

id_exp

a character string indicating a participant's identifier in the context of the particular study in which the participant was tested and invited to fill in the questionnaire. This value is always the same for each participant within the same study, so that different responses from the same participant in the same study share id_exp The same participant may have different id_exp across different studies.

id_db

a character string with five digits indicating a participant's identifier in the database from the Laboratori de Recerca en Infància at Universitat Pompeu Fabra. This value is always the same for each participant, so that different responses from the same participant share the same id_db.

code

a character string identifying a single response to the questionnaire. This value is always unique for each response to the questionnaire, even for responses from the same participant.

time

a numeric value indicating how many times a given participant has been sent the questionnaire, regardless of whether they completed it or not.

study

a character string indicating the study in which the participant was invited to fill in the questionnaire. Frequently, participants that filled in the questionnaire came to the lab to participant in a study, and were then invited to fill in the questionnaire later. This value indicates what study each participant was tested in before being sent the questionnaire.

version

a character string indicating what version of the questionnaire a given participant filled in. Different versions may contain a different subset of items, and the administration instructions might vary slightly (see formr questionnaire templates in the GitHub repository). Also, different versions were designed, implemented, and administrated at different time points (e.g., before/during/after the COVID-related lockdown).

date_sent

a date value (see lubridate package) in yyyy/mm/dd format indicating the date in which the questionnaire was sent to participants.

days_from_sent

a numeric value indicating the number of days elapsed since participants were sent the questionnaire (as indicated by date_sent) and completed the questionnaire.

date_birth

a date value (see lubridate package) in yyyy/mm/dd format indicating participants birth date.

age

a numeric value indicating the number of months elapsed since participants' birth date until they filled in the last item of their questionnaire response.

age_today

a numeric value indicating the number of months elapsed since participants' birth date until the present day, as indicated by now.

months_from_last_response

a numeric value indicating the number of months elapsed since participants' last questionnaire response (as indicated by time_stamp) until the present day, as indicated by now.

sex

a character string indicating participants' biological sex, as reported by the parents.

postcode

a character string indicating participants' household postcode.

edu_parent1

a character string indicating the educational attainment of one of the parents/caretakers.

edu_parent2

a character string indicating the educational attainment of the other parent/caretaker, if any.

dominance

a character string indicating the language of highest exposure ("Catalan" or "Spanish"), as reported by parents. If exposure is identical for both language, "Catalan" is assigned.

lp

a character string indicating participants' language profile, classified using parental reports of language exposure (see doe_spanish, doe_catalan, and doe_others), and the thresholds passed in the bilingual_threshold and other_threshold.

doe_spanish

a numeric value ranging from 0 to 1 indicating participants' daily exposure to Spanish, as estimated by parents/caretakers. This value aggregates participants' exposure to any variant of Spanish (e.g., European and American Spanish).

doe_catalan

a numeric value ranging from 0 to 1 indicating participants' daily exposure to Catalan, as estimated by parents/caretakers. This value aggregates participants' exposure to any variant of Catalan (e.g., Catalan from Majorca or Barcelona).

doe_others

a numeric value ranging from 0 to 1 indicating participants' daily exposure to languages other than Spanish or Catalan, as estimated by parents/caretakers, aggregating participants' exposure to all those other languages (e.g., Norwegian, Arab, Swahili).

progress

a numeric value ranging from 0 to 1 indicating participants' progress filling the questionnaire. A value of 0 indicates that the participant has not filled in any item yet. A value of 0.5 indicates that the participant is halfway through the questionnaire. A value of 1 indicates that the participant has completed all items.

completed

a logical value that returns TRUE if progress is 1, and FALSE otherwise.

Author

Gonzalo Garcia-Castro