CITE THIS NOTEBOOK: Comparing the distributions of the lengths of adjectives and nouns by Peter Cullen Burbery. Wolfram Community NOV 1 2022.
I was reading an Elementary Introduction to the Wolfram language and working on some exercises for words and I noticed that adjectives seemed longer than nouns, so I decided to investigate the matter with statistics.
I used as many statistical tools as I could to compare the lengths of adjectives and nouns.
I left other parts out like verbs because there's not as much data. I need lots of data and there are two few verbs to make good analysis. I also think its more complicated to compare 3 at once, though I guess it could be done.
A quick look shows that the 19 largest verbs aren't that interesting, in my opinion:
In[]:=
TakeLargestBy[WordList["Verb"],StringLength,19]
Out[]=
{institutionalize,intercommunicate,compartmentalize,internationalize,conventionalize,professionalize,hyperventilate,discountenance,contraindicate,overgeneralize,counterbalance,circumnavigate,sentimentalize,overcompensate,interpenetrate,disenfranchise,misappropriate,depersonalize,dematerialize}
The longest words are also smaller than nouns and adjectives, which have lengths of over 20.
In[]:=
ReverseSort[StringLength[WordList["Verb"]]][[4;;19]]
Out[]=
{16,15,15,14,14,14,14,14,14,14,14,14,14,14,13,13}
This is how the mass of the wordlist is divided, for example.
In[]:=
PieChart[AssociationMap[Length[WordList[#]]&,{"Noun","Verb","Adjective"}],ChartLabels->Automatic,PlotTheme->"Web"]
Out[]=
I noticed that adjectives tend to be longer.
I will Mathematica to investigate if this holds true for all the words in WordList.
In[]:=
TakeLargestBy[WordList["Adjective"],StringLength,12]
Out[]=
{electroencephalographic,counterrevolutionary,nonrepresentational,interdenominational,noninterchangeable,indistinguishable,interdepartmental,deconstructionist,electromechanical,interdisciplinary,institutionalized,counterproductive}
In[]:=
adjectivesData=StringLength[WordList["Adjective"]];
In[]:=
nounData=StringLength[WordList["Noun"]];
In[]:=
Histogram[adjectivesData]
Out[]=
I will also analyze other statistics for nouns and adjectives. I will first find the exact answer and then compute the numerical answer on the next line unless the answer is an exact integer for both nouns and adjectives.
I would like to mention that I am taking two courses right now and think analyzing word lengths is interesting. I am taking Probability and Statistics and Applied Probability and Statistics, so I think its interesting to analyze word lengths from this perspective.
I would also like to mention that I don't fully understand what some of the more advanced statistical functions like Qn dispersion do, but I think they're worth including anyway. There are some statistical functions that I wanted to use because they were in the guides Descriptive Statistics and Statistical Visualization but that I couldn't use because the data type wasn't right for example Covariance, Correlation, SpatialMedian, and Histogram3D.
Location statistics for lengths of adjectives and nouns
Location statistics for lengths of adjectives and nouns
In[]:=
Mean
Mean
In[]:=
{Mean[adjectivesData],Mean[nounData]}
Out[]=
,
97999
11392
196846
24493
In[]:=
N[{Mean[adjectivesData],Mean[nounData]}]
Out[]=
{8.60244,8.03683}
I think its interesting adjectives are longer than nouns on average.
In[]:=
Median
Median
In[]:=
{Median[adjectivesData],Median[nounData]}
Out[]=
{9,8}
The median is also higher for adjectives.
In[]:=
Mode
Mode
In[]:=
{Commonest[adjectivesData],Commonest[nounData]}
Out[]=
{{8},{8}}
The mode is the same, however.
In[]:=
Trimmed mean
Trimmed mean
Compute the 5% trimmed mean.
In[]:=
{TrimmedMean[adjectivesData],TrimmedMean[nounData]}
Out[]=
,
43876
5127
175209
22045
In[]:=
N[{TrimmedMean[adjectivesData],TrimmedMean[nounData]}]
Out[]=
{8.55783,7.94779}
The 5% trimmed mean for adjectives is also greater.
In[]:=
Winsorized mean
Winsorized mean
Compute the 5% winsorized mean.
In[]:=
{WinsorizedMean[adjectivesData],WinsorizedMean[nounData]}
Out[]=
,
48997
5696
196017
24493
In[]:=
N[{WinsorizedMean[adjectivesData],WinsorizedMean[nounData]}]
Out[]=
{8.602,8.00298}
The 5 % winsorized mean is also higher for adjectives than nouns.
Dispersion statistics for lengths of adjectives and nouns
Dispersion statistics for lengths of adjectives and nouns
Shape statistics for lengths of adjectives and nouns
Shape statistics for lengths of adjectives and nouns
General statistics for lengths of adjectives and nouns
General statistics for lengths of adjectives and nouns
I copied this function that creates a grid from the documentation:
In[]:=
FormulaGrid[list_,type_]:=Grid[Transpose[{list}],Alignment{Left,Automatic},Background{None,{{Lighter[Blend[Switch[type,M,{Blue,Green},CM,{Red,Orange},FM,{Magenta,Cyan},C,{Purple,Red}]],.8],White}}},Dividers{None,{Darker[Gray,.6],{False},Darker[Gray,.6]}},ItemSize30]
I will use this function to make tables of different moments and statistics for adjectives and nouns.
In[]:=
Moment
Moment
In[]:=
{FormulaGrid[Table[Moment[adjectivesData,k]//Together,{k,5}],M],FormulaGrid[Table[Moment[nounData,k]//Together,{k,5}],M]}
Out[]=
,
97999 11392 |
912597 11392 |
9093499 11392 |
96109317 11392 |
1070621419 11392 |
196846 24493 |
1756306 24493 |
17131246 24493 |
180528034 24493 |
2036572726 24493 |
In[]:=
Central Moment
Central Moment
In[]:=
Factorial moment
Factorial moment
In[]:=
Cumulant moment
Cumulant moment
In[]:=
Root mean square
Root mean square
I can also find the root mean square for nouns and adjectives.
I tried figuring out how to interpret the fact that the root mean square is higher for adjectives than nouns but I couldn't figure out what it means. I mostly found a bunch of result about electrical waves and root mean square error, so this may not be applicable to lengths of adjectives and nouns.
In[]:=
Expectation
Expectation
Find the expectation of the fourth power of the length of adjectives and nouns:
In[]:=
Probability
Probability
Find the probability the length of an adjective is greater than the average length of a noun, and vice versa:
There's about a 50% chance an adjective will be longer than the average noun and a 40% chance a noun will be longer than the average adjective.
In[]:=
BinCounts
BinCounts
I can find how many elements lie in successive integer bins for adjectives and nouns:
I can put this in a grid.
One thing I notice is there are a lot more nouns than adjectives. I am interested what the minimum and maximum for the bin counts for nouns and adjectives come out to.
I think its significant that the largest bin of adjectives has 1812 elements but the largest bin of nouns has much more 3621 total.
Visualizing with a histogram
Visualizing with a histogram
I can also stack the data:
I can also make a row of histograms:
Or a column of histograms:
I will now apply different binning methods.
Sturges binning
Sturges binning
The Sturges binning method computes the number of bins based on the length of data.
Scott binning
Scott binning
The Scott binning method computes the number of bins by asymptotically minimizing the mean square.
Freedman-Diaconis binning
Freedman-Diaconis binning
The Freedman-Diaconis binning method computes the number of bins by multiplying the interquartile range by two and then dividing by the cube root of the sample size.
Knuth
Knuth
The Knuth binning method balances likelihood and prior probability of a piecewise uniform model.
Wand binning
Wand binning
The Wand option uses one-level recursive approximate Wand binning to calculate the number of bins.
Count
Count
I can visualize the counts of data points in each bin.
Cumulative counts
Cumulative counts
I can visualize cumulative counts.
Survival counts
Survival counts
Probability
Probability
Intensity
Intensity
PDF probability density function
PDF probability density function
CDF cumulative distribution function
CDF cumulative distribution function
Survival function
Survival function
Hazard function
Hazard function
Cumulative hazard function
Cumulative hazard function