Miron Gleissner Auditing and Controlling in International Corporations 132741-D
# Loading the rought data into R
library(readr)
papers <- readRDS("C:/Users/Miron/OneDrive/Desktop/CCR/papers.rds")
library(ggplot2)
# Listing variables
variable_names <- names(papers)
print(variable_names)
[1] "IDx" "AU" "Author.s..ID"
[4] "TI" "PY" "SO"
[7] "VL" "IS" "Art..No."
[10] "Page.start" "Page.end" "PP"
[13] "TC" "DI" "URL"
[16] "Affiliations" "C1" "AB"
[19] "DE" "ID" "Molecular.Sequence.Numbers"
[22] "Chemicals.CAS" "Tradenames" "Manufacturers"
[25] "FU" "FX" "CR"
[28] "RP" "Editors" "Sponsors"
[31] "Publisher" "Conference.name" "Conference.date"
[34] "Conference.location" "Conference.code" "ISSN"
[37] "ISBN" "CODEN" "PubMed.ID"
[40] "LA" "JI" "DT"
[43] "Publication.Stage" "Open.Access" "DB"
[46] "UT" "J9" "AU_UN"
[49] "AU1_UN" "AU_UN_NR" "SR_FULL"
[52] "SR" "medeley"
# Extract specific variables
DF <- papers[c("AU","TC", "TI", "PY", "VL")]
# Load the required libraries
library(dplyr)
# Set parameters to make the sample population smaller
# Set total citations threshold
total_citations_threshold <- 3
# Filter the data to include only rows with total citations greater than the threshold
DF <- DF %>%
filter(TC > total_citations_threshold)
# Limiting to papers published after a certain year
publication_year_limit <- 2021
# Filter based on the publication year
DF <- DF %>%
filter(PY > publication_year_limit)
# Print the summary statistics and structure of the sampled data
summary(DF)
AU TC TI PY VL
Length:32 Min. : 4.000 Length:32 Min. :2022 Length:32
Class :character 1st Qu.: 4.000 Class :character 1st Qu.:2022 Class :character
Mode :character Median : 5.000 Mode :character Median :2022 Mode :character
Mean : 6.438 Mean :2022
3rd Qu.: 6.250 3rd Qu.:2022
Max. :16.000 Max. :2022
str(DF)
'data.frame': 32 obs. of 5 variables:
$ AU: chr "BIDDLE GC;MA MLZ;SONG FM" "BAILEY C" "KIM J-B;LEE JJ;PARK JC" "BROCKMAN P;KRISHNAN G;LEE HS;SALAS JM" ...
$ TC: num 5 8 6 5 4 6 4 6 14 4 ...
$ TI: chr "ACCOUNTING CONSERVATISM AND BANKRUPTCY RISK" "THE RELATIONSHIP BETWEEN CHIEF RISK OFFICER EXPERTISE, ERM QUALITY, AND FIRM PERFORMANCE" "INTERNAL CONTROL WEAKNESS AND THE ASYMMETRICAL BEHAVIOR OF SELLING, GENERAL, AND ADMINISTRATIVE COSTS" "IMPLICATIONS OF CEO SUCCESSION ORIGIN AND IN-HOUSE EXPERIENCE FOR AUDIT PRICING" ...
$ PY: num 2022 2022 2022 2022 2022 ...
$ VL: chr "37" "37" "37" "37" ...
Step 1
#Add number for the papers in the sample
library(readr)
DF <- as.data.frame(DF)
DF <- DF %>%
mutate(Paper_Number = row_number())
rownames(DF)<-DF$Paper_Number
head(DF)
colnames(DF)
[1] "AU" "TC" "TI" "PY" "VL" "Paper_Number"
#Now we look at the structure of our data
library(psych)
#Describing our statistic
describe(DF)
#Calculating the regression
TCY <- lm(TC ~ VL + PY, DF)
# Print the summary of TCY
summary(TCY)
Call:
lm(formula = TC ~ VL + PY, data = DF)
Residuals:
Min 1Q Median 3Q Max
-4.000 -1.583 -0.250 0.000 7.750
Coefficients: (1 not defined because of singularities)
Estimate Std. Error t value Pr(>|t|)
(Intercept) 4.250 1.712 2.483 0.0216 *
VL35 2.083 1.977 1.054 0.3039
VL37 1.750 2.421 0.723 0.4777
VL38 1.750 3.828 0.457 0.6522
VL54 0.750 3.828 0.196 0.8465
VL73 -0.250 3.828 -0.065 0.9485
VL82 4.000 2.421 1.652 0.1134
VL83 3.750 2.965 1.265 0.2198
VL84 0.750 3.828 0.196 0.8465
VL97 10.750 3.828 2.808 0.0105 *
VL98 0.750 3.828 0.196 0.8465
PY NA NA NA NA
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 3.424 on 21 degrees of freedom
Multiple R-squared: 0.3345, Adjusted R-squared: 0.01754
F-statistic: 1.055 on 10 and 21 DF, p-value: 0.4354
#Graphical results of our estimation
plot(TCY)
Warning: not plotting observations with leverage one:
17, 18, 19, 20, 31, 32
Lets proceed to Step 2
# Calculate the value of leverage
hats <- as.data.frame(hatvalues(TCY))
# Show value
hats
# Lets sort those values
hats[order(-hats['hatvalues(TCY)']), ]
Error in xtfrm.data.frame(x) : cannot xtfrm data frames
# Sort them
ordered_hats <- hats[order(-hats$`hatvalues(TCY)`), ]
# Print the ordered data frame
print(ordered_hats)
[1] 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 1.00000000 0.50000000 0.50000000 0.25000000
[10] 0.25000000 0.25000000 0.25000000 0.25000000 0.25000000 0.25000000 0.25000000 0.25000000 0.25000000
[19] 0.25000000 0.25000000 0.08333333 0.08333333 0.08333333 0.08333333 0.08333333 0.08333333 0.08333333
[28] 0.08333333 0.08333333 0.08333333 0.08333333 0.08333333
# Lets look at it graphically
plot(hatvalues(TCY), type = 'h')
Step 3
cutoff<-2*(6-1)/32
z<-hats> cutoff
z
hatvalues(TCY)
1 FALSE
2 FALSE
3 FALSE
4 FALSE
5 FALSE
6 FALSE
7 FALSE
8 FALSE
9 FALSE
10 FALSE
11 FALSE
12 FALSE
13 FALSE
14 FALSE
15 FALSE
16 FALSE
17 TRUE
18 TRUE
19 TRUE
20 TRUE
21 TRUE
22 TRUE
23 FALSE
24 FALSE
25 FALSE
26 FALSE
27 FALSE
28 FALSE
29 FALSE
30 FALSE
31 TRUE
32 TRUE
sum(z, na.rm=FALSE)
[1] 8
So, considering our variables and parameters, there are 8 influential papers in our data frame of 32 papers.
# Due to an Error I have to change the Name of one paper, so that I can print it
Warning message:
In gsub("^\\s+|\\s+$", "", y) :
unable to translate 'FIRMS<e2>\u0080\u0099 RESPONSE TO MACROECONOMIC ESTIMATION ERRORS ' to a wide string
# Finding the row index of the last influential paper
last_influential_row <- nrow(influential_papers)
# Changing the value of 'TI' for the last influential paper of our observation from "FIRMS' RESPONSE TO MACROECONOMIC ESTIMATION ERRORS" to "FIRMS RESPONSE TO MACROECONOMIC ESTIMATION ERRORS" so that we can print it
influential_papers$TI[last_influential_row] <- "FIRMS RESPONSE TO MACROECONOMIC ESTIMATION ERRORS"
print(influential_papers)
These are the influential papers of our sample.