Create the Data

business = c(83, 24245, 49935, (100000000 - 83 - 24245 - 49935))
action = c(114, 24214, 20143, (100000000 - 114 - 24214 - 20143))
business_action = as.data.frame(rbind(business, action))
colnames(business_action) = c("a", "b", "c", "d")
business_action
##            a     b     c        d
## business  83 24245 49935 99925737
## action   114 24214 20143 99955529

Load the Libraries + Functions

Load all the libraries or functions that you will use to for the rest of the assignment. It is helpful to define your libraries and functions at the top of a report, so that others can know what they need for the report to compile correctly.

```

Attraction and Reliance

Calculate the attraction for your bigrams.

attraction = business_action$a / (business_action$a + business_action$c) * 100
attraction
## [1] 0.1659403 0.5627684

Calculate the reliance for your bigrams.

reliance = business_action$a / (business_action$a + business_action$b) * 100
reliance
## [1] 0.3411707 0.4685959

Log Likelihood

Calculate the LL values for your bigrams.

aExp = (business_action$a + business_action$b) * (business_action$a + business_action$c) /
  (business_action$a + business_action$b + business_action$c + business_action$d)

Pointwise Mutual Information

Calculate the PMI for your bigrams.

PMI = log(business_action$a / aExp)^2
PMI
## [1] 3.68640 9.86739

Odds Ratio

Calculate the OR for your bigrams.

logOR = log(business_action$a * business_action$d / (business_action$b * business_action$c))
logOR
## [1] 1.924335 3.151136

Interpret your results

Given the statistics you have calculated above, what is the relation of your bigrams? Write a short summary of the results, making sure to answer the following:

The values of attraction, reliance: action and plan along with business and plan could be related - Do they attract or repel each other? The Log value being positive indicates that the both group of words attract each other - Are there differences between the separate bigrams?

There is a difference in seperate Bigrams, Odds ratio, PMI value and log liklihood value suggests that Action plan is way more popular compared to business plan