Skip to content

sjtobin/afrikaans-nasalization-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Socially Structured Coarticulatory Nasalization in Afrikaans

Reproducible R analysis for:

Coetzee, A., Beddor, P., Styler, W., Tobin, S., Bekker, I. & Wissing, D. (2022). Producing and Perceiving Socially Structured Coarticulation: Coarticulatory Nasalization in Afrikaans. Laboratory Phonology, 13(1).

This repository contains refactored supplementary analysis materials for the article "Producing and Perceiving Socially Structured Coarticulation: Coarticulatory Nasalization in Afrikaans" by Andries W. Coetzee, Patrice Speeter Beddor, Will Styler, Stephen Tobin, Ian Bekker, and Daan Wissing, published in the Journal of the Association for Laboratory Phonology.

The article is open access and available at: https://doi.org/10.16995/labphon.6450

Overview

The analysis examines socially structured coarticulatory nasalization in Afrikaans using speech production (nasal airflow) and perception data. The repository provides R scripts and adapted functions for the reproduction of the analyses, plots and corresponding statistical outputs present in the article.

The materials include analysis of:

  • nasal airflow production data,
  • eyetracking/fixation data from perception experiments,
  • GAMMs (cf. mgcv) and fPCAs (cf. rainbow) of the data.

Repository contents

afrikaans-nasalization-analysis
 ├── data
 ├── LICENSE
 ├── R
 │   ├── perception_pipeline.R
 │   ├── plot_methods
 │   │   ├── plot_diff2_sym.R
 │   │   ├── plot_diff_conds_blockcomp.R
 │   │   ├── plot_diff_conds_blockcompt.R
 │   │   ├── plot_diff_conds_slicecomp.R
 │   │   ├── plot_diff_conds_slicecompt.R
 │   │   ├── plot_diff_conds_speakercomp.R
 │   │   ├── plot_diff_conds_speakercompt.R
 │   │   └── plot.pca.fdst9.R
 │   ├── production_pipeline.R
 │   ├── setup.R
 │   └── utils
 │       ├── perception_data_utils.R
 │       ├── perception_plot_utils.R
 │       └── production_data_utils.R
 ├── README.md
 └── run_analysis.R

The script run_analysis.R calls all functions for data processing, reproducing the analytical workflow described in the paper. loading them and running the analysis.

Downloading the data

The data files are not included in this repository. They must be downloaded separately from the supplementary data archive:

http://bit.ly/Afr_Nas_Supplementary

The following data files are required to run the analysis:

flow.RData: production data -- nasal airflow centred on vowel onset
vnflow.RData: normalized production data (see paper for normalization method)
perc.RData: perception/eyetracking data
gamm.RData: GAMM output for fixation proportions
gamm_pc1.RData: GAMM output for fixation proportions with PC1
pc1_quartiles.RData: PC1 quartile values for participant groups
sptb.RData: speaker × participant × target nasality × block interaction factor levels

Place the downloaded .RData files in the data directory before running the analysis.

Requirements

The analysis requires an installation of R. The main script includes a setup step that checks for required packages, installs any that are missing, and loads them before running the analysis. In case of any package-related issues, try installing them manually:

install.packages("mgcv", "plyr", "dplyr", "itsadug", "tidyr", "fda", "rainbow")

Most of the script should run on a computer with a recent R installation and approximately 16 GB of RAM.

The largest GAMM analyses are present but commented out, since they were last run successfully on a machine with 64 GB of RAM. However, even loading and plotting the GAMM objects may require up to 32 GB of RAM. If you are unable to run the GAMM plotting sections locally, the remaining parts of the analysis can still be run independently by commenting out the relevant sections of the script.

How to run

After downloading the required data files and placing them in the data directory, run:

Rscript AfrikaansNasalsAnalysis.R

Alternatively, open AfrikaansNasalsAnalysis.R in RStudio and run the script interactively.

Citation

If you use this repository, please cite the associated article:

Coetzee, A. W., Beddor, P. S., Styler, W., Tobin, S., Bekker, I., & Wissing, D. (2022). Producing and Perceiving Socially Structured Coarticulation: Coarticulatory Nasalization in Afrikaans. Laboratory Phonology, 13(1). https://doi.org/10.16995/labphon.6450

If you reuse or adapt the analysis code, please also cite this repository. GitHub displays citation information from the CITATION.cff file.

License

This repository is licensed under the AGPL-3.0 license. See LICENSE for details.

About

Reproducible R analysis of Afrikaans nasal airflow and eyetracking data from Coetzee et al. (2022)

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages