Skip to content

Commit

Permalink
Causal Analysis on R
Browse files Browse the repository at this point in the history
  • Loading branch information
kylekao authored Mar 7, 2023
1 parent 869014a commit 50159a5
Show file tree
Hide file tree
Showing 2 changed files with 591 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Netflix_causal.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
library(ggplot2)
library(afex)
library(emmeans)
library(dplyr)
library(car)
library(corrplot)
library(psych)
library(palmerpenguins)
netflix.df = read.csv('/Users/kyle/Downloads/net.csv', header = T)
str(netflix.df)

modelnet1 <- lm(sbsci ~ GDP + Inflat + OTT + HBO + Hulu + Basic + Stand + Prem + Award + OriCnt + CntSpn + MktExp, data = netflix.df)
summary(modelnet1)

model2 <- lm(sbsci ~ OTT + MktExp, data=netflix.df)
summary(model2)

anova(modelnet1, model2)
result1 <- cor.test(netflix.df$sbsci,netflix.df$OTT, method = "pearson")
result2 <- cor.test(netflix.df$sbsci,netflix.df$MktExp, method = "pearson")
result1
result2

corrplot(cor(netflix.df[,c(2,3:13)]),method = 'ellipse', type = 'upper')
corrplot(cor(netflix.df[,c(2,5,13)]),method = 'ellipse', type = 'upper')
566 changes: 566 additions & 0 deletions Netflix_causal.html

Large diffs are not rendered by default.

0 comments on commit 50159a5

Please sign in to comment.