This collection of handouts provides a hands-on introduction to data analysis and statistical methods in quantitative corpus linguistics with R. It is designed with accessibility in mind, assuming no prior knowledge of programming or statistics. All you need to get started is a laptop; everything else will be explained within these pages.
Primarily, this reader is geared towards students attending the classes Language Variation (BA) and Statistics for Linguistics (MA) at the Catholic University of Eichstätt-Ingolstadt (Germany). However, it is also meant to equip students currently working on their BA/MA/PhD theses with the tools they need to conduct empirical studies on a wide array of linguistic phenomena. The methods presented here reflect the state-of-the-art in corpus-linguistic research, providing readers with current and relevant analytical techniques.
Introduction to R
|
Title
|
Description
|
|
1.1 First steps
|
This unit outlines why R is worth learning for corpus-linguistic research and guides you through installing R and RStudio.
|
|
1.2 Exploring RStudio
|
This unit introduces the RStudio interface and illustrates how to interact with R via the console, store and reuse values in variables, and preserve your work in R scripts.
|
|
1.3 Vectors
|
We introduce vectors as our first data structure in R and explore some common applications and manipulations.
|
|
1.4 Data frames
|
This unit introduces data frames in R, covering their creation, subsetting and filtering (with both base R and the tidyverse), and includes practice exercises on accessing and manipulating structured linguistic data.
|
|
1.5 Libraries
|
This handout explains how to install, load and cite R packages that are essential for data analysis and linguistic applications.
|
|
1.6 Importing/exporting data
|
This handout provides practical guidance on importing, exporting and storing data in R using CSV, Excel and RDS formats, with strategies for troubleshooting common issues.
|
No matching items
NLP with R
|
Title
|
Description
|
|
2.1 Concordancing
|
This unit introduces the concept of a corpus and concordancing with R using the quanteda package, demonstrating keyword-in-context searches, data export, and the analysis of dispersion and word frequencies for transparent corpus-linguistic research.
|
|
2.2 Regular expressions
|
This handout introduces regular expressions for advanced corpus queries in R and on corpus platforms, showing how to construct, refine and apply search patterns to linguistic data.
|
|
2.3 The CQP interface
|
This supplementary handout introduces the CQP query syntax used on corpus platforms such as CQPweb, covering queries for word forms, lemmas and part-of-speech tags, sequences of tokens, the main differences to regular expressions in quanteda, and how to export the results for further analysis in R.
|
|
2.4 Data annotation
|
This handout exemplifies the workflow from a corpus query to an annotated dataset, covering the retrieval of concordance lines with quanteda, manual annotation in a spreadsheet, the handling of false hits, re-importing the data into R and extracting register information from the ICE text categories.
|
No matching items
Statistics
|
Title
|
Description
|
|
3.1 Data, variables, samples
|
This handout introduces key statistical concepts—such as samples, populations, variables, datasets and data types—with a focus on their application to empirical linguistic research, using R to explore and illustrate these ideas.
|
|
3.2 Probability theory
|
This section covers essential concepts from probability theory: relative frequencies and probabilities, conditional probability and Bayes’ theorem, expected values and variances, as well as the most important discrete and continuous probability distributions.
|
|
3.3 Descriptive statistics
|
This handout provides a comprehensive, hands-on introduction to descriptive and bivariate statistics for both categorical and continuous linguistic data, including data visualisation, summary measures, correlation and exporting tables, with practical exercises in R using real-world datasets.
|
|
3.4 Hypothesis testing
|
This handout introduces the principles of scientific inference and null hypothesis significance testing (NHST) for both categorical and continuous linguistic data, covering hypothesis formulation, test statistics, sampling distributions, \(p\)-values, Type I/II errors, statistical power and common misinterpretations of significance, with illustrative examples from linguistic research.
|
|
3.5 Chi-squared test
|
The chi-squared (\(\chi^2\)) test helps determine if there is a statistically significant association between two categorical variables. It compares the observed frequencies of categories with those expected under the null hypothesis. The \(\chi^2\) (chi-squared) score quantifies the differences between observed and expected frequencies across all cells of a contingency table. The greater the difference between observed and expected, the higher the \(\chi^2\) score and the lower the \(p\)-value, given the degrees of freedom. It is recommended to compute effect size measures and inspect the residuals to assess the nature of the association.
|
|
3.6 t-test
|
This handout covers the application of \(t\)-tests for independent and paired samples, including visualisation, assumption checks, effect size calculation and the reporting of results, with practical examples from phonetic and psycholinguistic data and exercises on statistical interpretation.
|
|
3.7 ANOVA
|
This supplementary handout introduces one-way analysis of variance (ANOVA) for comparing the means of three or more groups, covering the decomposition of variance, the F-test, effect sizes, assumption checks and post-hoc comparisons with Tukey’s HSD test, using psycholinguistic data on verb polysemy.
|
|
3.8 Case study: Object realisation of EAT
|
This handout presents a complete analysis of categorical corpus data, from the research question to the write-up. Using annotated concordance lines of the verb EAT from ICE-GB, it combines descriptive statistics, the chi-squared test, Fisher’s exact test, effect sizes, residuals and configural frequency analysis.
|
No matching items
Models
|
Title
|
Description
|
|
4.1 Linear regression
|
This handout introduces linear regression for modelling continuous response variables, covering least squares estimation, the interpretation of model output, model visualisation, assumption checks and the evaluation of model performance via test data and cross-validation, using reaction time data from the English Lexicon Project.
|
|
4.2 Logistic regression
|
This handout introduces logistic regression for modelling binary response variables, covering log odds and odds ratios, maximum likelihood estimation, model fitting and diagnostics in R, and the interpretation and visualisation of model output, using corpus data on subject pronoun realisation in varieties of English.
|
|
4.4 Poisson regression
|
This handout introduces Poisson regression for modelling count data, covering the Poisson distribution, the log link, the interpretation of coefficients as multiplicative effects, overdispersion and negative binomial regression as well as offsets for corpus frequencies, using sensory ratings and frequencies of English adjectives.
|
No matching items
Machine Learning
|
Title
|
Description
|
|
5.1 Tree-based methods
|
This handout introduces decision trees and random forests, two powerful non-parametric methods based on recursive partitioning. It covers classification and regression trees (CART), pruning, conditional inference trees, random forests, variable importance measures and partial dependence plots, using data on Russian T/V pronouns and lexical decision times.
|
|
5.2 Gradient boosting
|
Gradient boosting constitutes a powerful extension of tree-based methods and is generally appreciated for its high predictive performance. Nevertheless, this family of methods, which includes implementations such as AdaBoost, XGBoost, and CatBoost, among many others, is not yet established in corpus-linguistic statistics. A practical scenario is presented to introduce the core ideas of gradient boosting, demonstrate its application to linguistic data as well as point out its advantages and drawbacks.
|
No matching items