5. Contingency
Table
Levels
Class
Conditional
Tree
2x2 Contingency Tables
1 Let’s build a table for R.Use and Lexical.Item
attach(categoricaldata) (remember to run your
commands)
2 table(A,B): A - rows, B - columns
table(R.Use, Lexical.Item)
3 Let’s name it mytable
mytable <- table(R.Use, Lexical.Item)
4 / 22
17. Contingency
Table
Levels
Class
Conditional
Tree
Recap: Regression Analysis
Type of Variables
a.) Binary/categorical (only two values)
b.) Continuous (numeric)
c.) Multinomial - categorical with more than two values -
mlogit
Regression Types
a.) Logistic regression - binary categorical -glm
b.) Linear - only continuous - lm and lme4
15 / 22
18. Contingency
Table
Levels
Class
Conditional
Tree
Conditional Tree Regression
Conditional tree: a simple non-parametric regression analysis,
commonly used in social and psychological studies
Linear/logistic regression: all information is combined linearly
Conditional tree regression: splitting to capture interaction
between variables
Recursive splitting (tree branches)
16 / 22
23. Contingency
Table
Levels
Class
Conditional
Tree
Conditional Tree
1 Store is the most significant factor for R-use
Kleins (working class store) - more R-deletion
2 R-use in Macy’s and Saks is conditioned by lexical item:
Floor shows more R-retention than Fourth
3 Style is not significant
20 / 22
24. Contingency
Table
Levels
Class
Conditional
Tree
Changing Fonts
fontsize
col - colour
lwd - line width
plot(mytree, main=“Conditional Inference
Tree”,gp=gpar(fontsize=10))
Change font size to 5 and 15
plot(mytree, main=“Conditional Inference
Tree”,gp=gpar(fontsize=10,col=“red”,lwd=1.2))
Change color and line width
21 / 22