R Markdown

library(ggplot2) > library(gridExtra) > set.seed(42) > y <- runif(100, min = 0, max = 50) > z <- runif(100, min = 1, max = 12) > x <- 2 * y + z > model <- lm(y ~ x) > df1 <- data.frame(x, z) > df <- data.frame(x, y) > df2 <- rbind(df, c(75, 0.5)) > df3 <- rbind(df1, c(75, 0.5)) > plot1 <- ggplot(df1, aes(z, y)) + + geom_point() + + theme_bw() + + labs(x = ‘Independent variables’, y = ‘Yearly number of citations’) + + ggtitle(“Panel A”) > plot2 <- ggplot(df, aes(x, y)) + + geom_point() + + theme_bw() + + labs(x = ‘Independent variables’, y = ‘Yearly number of citations’) + + ggtitle(“Panel B”) > plot1a <- ggplot(df1, aes(z, y)) + + geom_point() + + geom_smooth(method = lm) + + theme_bw() + + labs(x = ‘Independent variables’, y = ‘Yearly number of citations’) + + ggtitle(“Panel C”) > plot2a <- ggplot(df, aes(x, y)) + + geom_point() + + geom_smooth(method = lm) + + theme_bw() + + labs(x = ‘Independent variables’, y = ‘Yearly number of citations’) + + ggtitle(“Panel D”) > coeff <- coefficients(model) > intercept <- coeff[1] > slope <- coeff[2] > plot3 <- ggplot(df3, aes(x, z)) + + geom_point() + + geom_smooth(method = lm) + + theme_bw() + + labs(x = ‘Independent variables’, y = ‘Yearly number of citations’) + + annotate(“point”, x = 10, y = 0.5, colour = “red”) + + geom_abline(intercept = intercept, slope = slope, color = “red”, linetype = “solid”, size = 1.5) + + ggtitle(“Panel E”) Warning message: Using size aesthetic for lines was deprecated in ggplot2 3.4.0. ℹ Please use linewidth instead. This warning is displayed once every 8 hours. Call lifecycle::last_lifecycle_warnings() to see where this warning was generated. > plot4 <- ggplot(df2, aes(x, y)) + + geom_point() + + geom_smooth(method = lm) + + geom_smooth() + + theme_bw() + + labs(x = ‘Independent variables’, y = ‘Yearly number of citations’) + + annotate(“point”, x = 75, y = 0.5, colour = “red”) + + geom_abline(intercept = intercept, slope = 0.2, color = “red”, linetype = “solid”, size = 1.5) + + ggtitle(“Panel F”) > ggsave(“plot1.png”, plot1, dpi = 300) Saving 7 x 7 in image > Saving 7 x 5 in image Error: unexpected numeric constant in “Saving 7” > ggsave(“plot2.png”, plot2, dpi = 300) Saving 7 x 7 in image > ggsave(“plot1a.png”, plot1a, dpi = 300) Saving 7 x 7 in image geom_smooth() using formula = ‘y ~ x’ > ggsave(“plot2a.png”, plot2a, dpi = 300) Saving 7 x 7 in image geom_smooth() using formula = ‘y ~ x’ > ggsave(“plot3.png”, plot3, dpi = 300) Saving 7 x 7 in image geom_smooth() using formula = ‘y ~ x’ > ggsave(“plot4.png”, plot4, dpi = 300) Saving 7 x 7 in image geom_smooth() using formula = ‘y ~ x’ geom_smooth() using method = ‘loess’ and formula = ‘y ~ x’ > knitr::include_graphics(“plot1.png”) Error in loadNamespace(x) : there is no package called ‘knitr’ > install.packages(“knitr”) Installing package into ‘/cloud/lib/x86_64-pc-linux-gnu-library/4.3’ (as ‘lib’ is unspecified) also installing the dependencies ‘evaluate’, ‘highr’, ‘xfun’, ‘yaml’

trying URL ‘http://rspm/default/__linux__/focal/latest/src/contrib/evaluate_0.23.tar.gz’ Content type ‘application/x-gzip’ length 82039 bytes (80 KB) ================================================== downloaded 80 KB

trying URL ‘http://rspm/default/__linux__/focal/latest/src/contrib/highr_0.10.tar.gz’ Content type ‘application/x-gzip’ length 38964 bytes (38 KB) ================================================== downloaded 38 KB

trying URL ‘http://rspm/default/__linux__/focal/latest/src/contrib/xfun_0.41.tar.gz’ Content type ‘application/x-gzip’ length 428557 bytes (418 KB) ================================================== downloaded 418 KB

trying URL ‘http://rspm/default/__linux__/focal/latest/src/contrib/yaml_2.3.8.tar.gz’ Content type ‘application/x-gzip’ length 114044 bytes (111 KB) ================================================== downloaded 111 KB

trying URL ‘http://rspm/default/__linux__/focal/latest/src/contrib/knitr_1.45.tar.gz’ Content type ‘application/x-gzip’ length 1469109 bytes (1.4 MB) ================================================== downloaded 1.4 MB

The downloaded source packages are in ‘/tmp/Rtmp3PrkKe/downloaded_packages’ > library(knitr) > knitr::include_graphics(“plot1.png”) [1] “plot1.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”
> knitr::include_graphics(“plot2.png”) [1] “plot2.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”
> knitr::include_graphics(“plot1a.png”) [1] “plot1a.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”
> knitr::include_graphics(“plot2a.png”) [1] “plot2a.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”
> knitr::include_graphics(“plot3.png”) [1] “plot3.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”
> knitr::include_graphics(“plot4.png”) [1] “plot4.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”
> install.packages(“readr”) Installing package into ‘/cloud/lib/x86_64-pc-linux-gnu-library/4.3’ (as ‘lib’ is unspecified) also installing the dependencies ‘bit’, ‘prettyunits’, ‘bit64’, ‘tidyselect’, ‘progress’, ‘clipr’, ‘crayon’, ‘hms’, ‘vroom’, ‘cpp11’, ‘tzdb’

trying URL ‘http://rspm/default/__linux__/focal/latest/src/contrib/bit_4.0.5.tar.gz’ Content type ‘application/x-gzip’ length 1130353 bytes (1.1 MB) ================================================== downloaded 1.1 MB

trying URL ‘http://rspm/default/__linux__/focal/latest/src/contrib/prettyunits_1.2.0.tar.gz’ Content type ‘application/x-gzip’ length 154935 bytes (151 KB) ================================================== downloaded 151 KB

trying URL ‘http://rspm/default/__linux__/focal/latest/src/contrib/bit64_4.0.5.tar.gz’ Content type ‘application/x-gzip’ length 475822 bytes (464 KB) ================================================== downloaded 464 KB

trying URL ‘http://rspm/default/__linux__/focal/latest/src/contrib/tidyselect_1.2.0.tar.gz’ Content type ‘application/x-gzip’ length 220056 bytes (214 KB) ================================================== downloaded 214 KB

trying URL ‘http://rspm/default/__linux__/focal/latest/src/contrib/progress_1.2.3.tar.gz’ Content type ‘application/x-gzip’ length 84587 bytes (82 KB) ================================================== downloaded 82 KB

trying URL ‘http://rspm/default/__linux__/focal/latest/src/contrib/clipr_0.8.0.tar.gz’ Content type ‘application/x-gzip’ length 50039 bytes (48 KB) ================================================== downloaded 48 KB

trying URL ‘http://rspm/default/__linux__/focal/latest/src/contrib/crayon_1.5.2.tar.gz’ Content type ‘application/x-gzip’ length 159631 bytes (155 KB) ================================================== downloaded 155 KB

trying URL ‘http://rspm/default/__linux__/focal/latest/src/contrib/hms_1.1.3.tar.gz’ Content type ‘application/x-gzip’ length 98422 bytes (96 KB) ================================================== downloaded 96 KB

trying URL ‘http://rspm/default/__linux__/focal/latest/src/contrib/vroom_1.6.5.tar.gz’ Content type ‘application/x-gzip’ length 958243 bytes (935 KB) ================================================== downloaded 935 KB

trying URL ‘http://rspm/default/__linux__/focal/latest/src/contrib/cpp11_0.4.7.tar.gz’ Content type ‘application/x-gzip’ length 280219 bytes (273 KB) ================================================== downloaded 273 KB

trying URL ‘http://rspm/default/__linux__/focal/latest/src/contrib/tzdb_0.4.0.tar.gz’ Content type ‘application/x-gzip’ length 643410 bytes (628 KB) ================================================== downloaded 628 KB

trying URL ‘http://rspm/default/__linux__/focal/latest/src/contrib/readr_2.1.4.tar.gz’ Content type ‘application/x-gzip’ length 884244 bytes (863 KB) ================================================== downloaded 863 KB

The downloaded source packages are in ‘/tmp/Rtmp3PrkKe/downloaded_packages’ > readxl Error: object ‘readxl’ not found > install.packages(“readxl”) Installing package into ‘/cloud/lib/x86_64-pc-linux-gnu-library/4.3’ (as ‘lib’ is unspecified) also installing the dependencies ‘rematch’, ‘cellranger’

trying URL ‘http://rspm/default/__linux__/focal/latest/src/contrib/rematch_2.0.0.tar.gz’ Content type ‘application/x-gzip’ length 15945 bytes (15 KB) ================================================== downloaded 15 KB

trying URL ‘http://rspm/default/__linux__/focal/latest/src/contrib/cellranger_1.1.0.tar.gz’ Content type ‘application/x-gzip’ length 101037 bytes (98 KB) ================================================== downloaded 98 KB

trying URL ‘http://rspm/default/__linux__/focal/latest/src/contrib/readxl_1.4.3.tar.gz’ Content type ‘application/x-gzip’ length 871762 bytes (851 KB) ================================================== downloaded 851 KB

The downloaded source packages are in ‘/tmp/Rtmp3PrkKe/downloaded_packages’ > install.packages(“psych”) Installing package into ‘/cloud/lib/x86_64-pc-linux-gnu-library/4.3’ (as ‘lib’ is unspecified) also installing the dependency ‘mnormt’

trying URL ‘http://rspm/default/__linux__/focal/latest/src/contrib/mnormt_2.1.1.tar.gz’ Content type ‘application/x-gzip’ length 172278 bytes (168 KB) ================================================== downloaded 168 KB

trying URL ‘http://rspm/default/__linux__/focal/latest/src/contrib/psych_2.3.12.tar.gz’ Content type ‘application/x-gzip’ length 4039922 bytes (3.9 MB) ================================================== downloaded 3.9 MB

The downloaded source packages are in ‘/tmp/Rtmp3PrkKe/downloaded_packages’ > install.packages(c(“readr”, “readxl”, “psych”)) Installing packages into ‘/cloud/lib/x86_64-pc-linux-gnu-library/4.3’ (as ‘lib’ is unspecified) trying URL ‘http://rspm/default/__linux__/focal/latest/src/contrib/readr_2.1.4.tar.gz’ Content type ‘application/x-gzip’ length 884244 bytes (863 KB) ================================================== downloaded 863 KB

trying URL ‘http://rspm/default/__linux__/focal/latest/src/contrib/readxl_1.4.3.tar.gz’ Content type ‘application/x-gzip’ length 871762 bytes (851 KB) ================================================== downloaded 851 KB

trying URL ‘http://rspm/default/__linux__/focal/latest/src/contrib/psych_2.3.12.tar.gz’ Content type ‘application/x-gzip’ length 4039922 bytes (3.9 MB) ================================================== downloaded 3.9 MB

The downloaded source packages are in ‘/tmp/Rtmp3PrkKe/downloaded_packages’ > library(readxl) > library(psych)

Attaching package: ‘psych’

The following objects are masked from ‘package:ggplot2’:

%+%, alpha

scopus <- read_excel(“scopus.xlsx”) Error: path does not exist: ‘scopus.xlsx’ scopus dataframe Error: unexpected symbol in “scopus dataframe” scopus <- read_excel(“scopus.xlsx”) Error: path does not exist: ‘scopus.xlsx’ scopus <- read_excel(“scopus.xlsx”) Error: path does not exist: ‘scopus.xlsx’ library(readr) DF <- read_csv(file.choose()) Rows: 67 Columns: 13 ta: 0s ── Column specification ──────────────────────────────────────────────────── Delimiter: “,” dbl (13): PublicationYears, BigSample, Method, AngloSaxon, USA, TimeSpan…

ℹ Use spec() to retrieve the full column specification for this data. ℹ Specify the column types or set show_col_types = FALSE to quiet this message. > scopus <- read_excel(“scopus.xlsx”) Error: path does not exist: ‘scopus.xlsx’ > install.packages(c(“readr”, “readxl”, “psych”)) Error in install.packages : Updating loaded packages

Restarting R session…

install.packages(c(“readr”, “readxl”, “psych”)) Installing packages into ‘/cloud/lib/x86_64-pc-linux-gnu-library/4.3’ (as ‘lib’ is unspecified) trying URL ‘http://rspm/default/__linux__/focal/latest/src/contrib/readr_2.1.4.tar.gz’ Content type ‘application/x-gzip’ length 884244 bytes (863 KB) ================================================== downloaded 863 KB

trying URL ‘http://rspm/default/__linux__/focal/latest/src/contrib/readxl_1.4.3.tar.gz’ Content type ‘application/x-gzip’ length 871762 bytes (851 KB) ================================================== downloaded 851 KB

trying URL ‘http://rspm/default/__linux__/focal/latest/src/contrib/psych_2.3.12.tar.gz’ Content type ‘application/x-gzip’ length 4039922 bytes (3.9 MB) ================================================== downloaded 3.9 MB

The downloaded source packages are in ‘/tmp/RtmpDOvuYm/downloaded_packages’ > library(readxl) > library(psych) > scopus <- read_excel(book1.xlsx) Error: object ‘book1.xlsx’ not found > scopus <- read_excel(“Book1.xlsx” + head(scopus) Error: unexpected symbol in: “scopus <- read_excel(”Book1.xlsx” head” > scopus <- read_excel(“Book.xlsx”) Error: path does not exist: ‘Book.xlsx’ > library(readxl) > Book1 <- read_excel(“Book1.xlsx”) > View(Book1)
> scopus <- read_excel(“scopus.xlsx”) Error: path does not exist: ‘scopus.xlsx’ > scopus <- read_excel(“Book1.xlsx”)

head(Book1) # A tibble: 6 × 13 PublicationYears BigSample Method AngloSaxon USA TimeSpan Sample 1 35 0 0 1 1 0 243 2 33 0 0 1 1 0 410 3 22 0 1 1 1 1 98 4 22 0 1 1 1 3 860 5 20 0 0 0 0 0 287 6 16 0 0 0 0 0 2428 # ℹ 6 more variables: BusinessSupport , TC , TCYear , # EXCLUDED , PY , Nr_Papieru colnames(scopus) [1] “PublicationYears” “BigSample” “Method”
[4] “AngloSaxon” “USA” “TimeSpan”
[7] “Sample” “BusinessSupport” “TC”
[10] “TCYear” “EXCLUDED” “PY”
[13] “Nr_Papieru”
library(knitr) kable(scopus)

PublicationYears BigSample Method AngloSaxon USA TimeSpan Sample BusinessSupport TC TCYear EXCLUDED PY Nr_Papieru
35 0 0 1 1 0 243.000 0 0 0.0000000 0 1980 2
33 0 0 1 1 0 410.000 0 4 0.1212121 0 1982 3
22 0 1 1 1 1 98.000 0 49 2.2272727 0 1993 5
22 0 1 1 1 3 860.000 0 35 1.5909091 0 1993 6
20 0 0 0 0 0 287.000 0 6 0.3000000 0 1995 7
16 0 0 0 0 0 2428.000 0 7 0.4375000 0 1999 8
14 0 1 1 0 1 132.000 0 6 0.4285714 0 2001 9
13 0 1 1 1 1 287.000 0 86 6.6153846 0 2002 10
13 1 1 1 1 1 2428.000 0 194 14.9230769 0 2002 11
13 1 1 1 0 2 2107.000 0 62 4.7692308 0 2002 12
12 1 0 1 1 1 2666.000 0 89 7.4166667 0 2003 15
12 1 1 1 1 1 1871.000 0 129 10.7500000 0 2003 19
12 1 1 1 1 1 3170.000 0 227 18.9166667 0 2003 20
11 0 1 1 1 6 979.000 0 132 12.0000000 0 2004 21
11 1 1 1 1 2 5103.000 1 108 9.8181818 0 2004 22
11 0 0 1 1 0 3746.000 0 3 0.2727273 0 2004 23
11 0 0 0 0 0 43.000 0 9 0.8181818 0 2004 24
10 0 1 1 1 1 248.000 0 10 1.0000000 0 2005 29
10 0 1 1 0 11 290.000 0 0 0.0000000 0 2005 30
9 0 1 1 1 1 100.000 1 14 1.5555556 0 2006 35
9 0 0 1 1 0 3.483 0 8 0.8888889 0 2006 36
9 0 1 1 0 3 624.000 0 12 1.3333333 0 2006 37
9 0 0 0 0 27 147.000 0 121 13.4444444 0 2006 38
9 1 1 1 0 8 3746.000 0 37 4.1111111 0 2006 43
9 0 0 1 1 40 43.000 0 23 2.5555556 0 2006 44
8 0 1 0 0 2 254.000 0 3 0.3750000 0 2007 45
8 0 1 1 1 1 335.000 0 3 0.3750000 0 2007 46
7 0 1 1 0 1 392.000 0 11 1.5714286 0 2008 51
7 0 0 1 0 1 283.000 0 1 0.1428571 0 2008 52
7 0 1 1 0 7 237.000 0 6 0.8571429 0 2008 53
7 1 1 1 1 2 1117.000 0 1 0.1428571 0 2008 54
7 1 1 1 1 2 1692.000 0 37 5.2857143 0 2008 55
6 0 1 1 0 6 653.000 0 5 0.8333333 0 2009 62
6 0 1 1 1 2 408.000 0 3 0.5000000 0 2009 63
6 1 1 1 1 6 51755.000 0 12 2.0000000 0 2009 64
6 0 1 1 1 4 92.000 0 9 1.5000000 0 2009 67
6 0 1 0 0 1 135.000 0 1 0.1666667 0 2009 68
5 0 0 0 0 0 349.000 0 1 0.2000000 0 2010 77
5 1 1 1 1 2 3313.000 0 1 0.2000000 0 2010 78
4 0 1 1 1 2 497.000 1 10 2.5000000 0 2011 88
4 0 1 0 0 5 565.000 0 2 0.5000000 0 2011 90
4 0 1 1 0 4 540.000 0 6 1.5000000 0 2011 91
3 0 1 0 0 1 249.000 0 0 0.0000000 0 2012 101
3 0 0 0 0 40 40.000 0 3 1.0000000 0 2012 102
3 0 0 1 1 0 0.000 0 0 0.0000000 0 2012 103
3 0 1 1 1 2 350.000 0 0 0.0000000 0 2012 104
3 1 0 1 0 8 1157.000 0 0 0.0000000 0 2012 105
3 0 1 0 0 3 512.000 0 0 0.0000000 0 2012 106
3 1 1 0 0 6 1114.000 0 0 0.0000000 0 2012 107
3 0 1 1 0 2 230.000 0 2 0.6666667 0 2012 108
2 1 1 1 0 1 4067.000 0 0 0.0000000 0 2013 117
2 1 1 0 0 5 2154.000 0 0 0.0000000 0 2013 118
2 0 0 0 0 1 420.000 0 1 0.5000000 0 2013 119
2 0 0 0 0 8 607.000 0 0 0.0000000 0 2013 120
2 0 1 0 0 1 131.000 0 0 0.0000000 0 2013 121
2 0 0 0 0 1 0.000 0 0 0.0000000 0 2013 122
2 0 1 0 0 5 50.000 0 3 1.5000000 0 2013 123
2 1 1 1 1 3 1281.000 0 3 1.5000000 0 2013 124
2 0 1 1 1 1 86.000 0 0 0.0000000 0 2013 127
1 0 0 1 0 12 0.000 0 0 0.0000000 0 2014 128
1 0 1 1 0 0 371.000 0 2 2.0000000 0 2014 129
1 1 1 1 1 0 3261.000 0 0 0.0000000 0 2014 130
1 1 1 1 0 0 6274.000 0 3 3.0000000 0 2014 131
0 0 1 1 1 0 256.000 0 0 0.0000000 0 2015 136
0 0 0 0 0 0 212.000 0 0 0.0000000 0 2015 137
36 0 1 0 0 0 0.000 0 1 0.0277778 0 1979 1
31 0 1 0 0 0 98.000 0 8 0.2580645 0 1984 4

TCY <- lm(Citedby ~ Year + Citedby + BusinessSupport + UnitedState + PublicationYear + CitationbyYear, data = scopus) Error in eval(predvars, data, env) : object ‘Citedby’ not found library(readxl) scopus <- read_excel(“scopus.xlsx”) View(scopus)
head(scopus) # A tibble: 6 × 13 PublicationYears BigSample Method AngloSaxon USA TimeSpan Sample 1 35 0 0 1 1 0 243 2 33 0 0 1 1 0 410 3 22 0 1 1 1 1 98 4 22 0 1 1 1 3 860 5 20 0 0 0 0 0 287 6 16 0 0 0 0 0 2428 # ℹ 6 more variables: BusinessSupport , TC , TCYear , # EXCLUDED , PY , Nr_Papieru colnames(scopus) [1] “PublicationYears” “BigSample” “Method”
[4] “AngloSaxon” “USA” “TimeSpan”
[7] “Sample” “BusinessSupport” “TC”
[10] “TCYear” “EXCLUDED” “PY”
[13] “Nr_Papieru”
library(knitr) kable(scopus)

PublicationYears BigSample Method AngloSaxon USA TimeSpan Sample BusinessSupport TC TCYear EXCLUDED PY Nr_Papieru
35 0 0 1 1 0 243.000 0 0 0.0000000 0 1980 2
33 0 0 1 1 0 410.000 0 4 0.1212121 0 1982 3
22 0 1 1 1 1 98.000 0 49 2.2272727 0 1993 5
22 0 1 1 1 3 860.000 0 35 1.5909091 0 1993 6
20 0 0 0 0 0 287.000 0 6 0.3000000 0 1995 7
16 0 0 0 0 0 2428.000 0 7 0.4375000 0 1999 8
14 0 1 1 0 1 132.000 0 6 0.4285714 0 2001 9
13 0 1 1 1 1 287.000 0 86 6.6153846 0 2002 10
13 1 1 1 1 1 2428.000 0 194 14.9230769 0 2002 11
13 1 1 1 0 2 2107.000 0 62 4.7692308 0 2002 12
12 1 0 1 1 1 2666.000 0 89 7.4166667 0 2003 15
12 1 1 1 1 1 1871.000 0 129 10.7500000 0 2003 19
12 1 1 1 1 1 3170.000 0 227 18.9166667 0 2003 20
11 0 1 1 1 6 979.000 0 132 12.0000000 0 2004 21
11 1 1 1 1 2 5103.000 1 108 9.8181818 0 2004 22
11 0 0 1 1 0 3746.000 0 3 0.2727273 0 2004 23
11 0 0 0 0 0 43.000 0 9 0.8181818 0 2004 24
10 0 1 1 1 1 248.000 0 10 1.0000000 0 2005 29
10 0 1 1 0 11 290.000 0 0 0.0000000 0 2005 30
9 0 1 1 1 1 100.000 1 14 1.5555556 0 2006 35
9 0 0 1 1 0 3.483 0 8 0.8888889 0 2006 36
9 0 1 1 0 3 624.000 0 12 1.3333333 0 2006 37
9 0 0 0 0 27 147.000 0 121 13.4444444 0 2006 38
9 1 1 1 0 8 3746.000 0 37 4.1111111 0 2006 43
9 0 0 1 1 40 43.000 0 23 2.5555556 0 2006 44
8 0 1 0 0 2 254.000 0 3 0.3750000 0 2007 45
8 0 1 1 1 1 335.000 0 3 0.3750000 0 2007 46
7 0 1 1 0 1 392.000 0 11 1.5714286 0 2008 51
7 0 0 1 0 1 283.000 0 1 0.1428571 0 2008 52
7 0 1 1 0 7 237.000 0 6 0.8571429 0 2008 53
7 1 1 1 1 2 1117.000 0 1 0.1428571 0 2008 54
7 1 1 1 1 2 1692.000 0 37 5.2857143 0 2008 55
6 0 1 1 0 6 653.000 0 5 0.8333333 0 2009 62
6 0 1 1 1 2 408.000 0 3 0.5000000 0 2009 63
6 1 1 1 1 6 51755.000 0 12 2.0000000 0 2009 64
6 0 1 1 1 4 92.000 0 9 1.5000000 0 2009 67
6 0 1 0 0 1 135.000 0 1 0.1666667 0 2009 68
5 0 0 0 0 0 349.000 0 1 0.2000000 0 2010 77
5 1 1 1 1 2 3313.000 0 1 0.2000000 0 2010 78
4 0 1 1 1 2 497.000 1 10 2.5000000 0 2011 88
4 0 1 0 0 5 565.000 0 2 0.5000000 0 2011 90
4 0 1 1 0 4 540.000 0 6 1.5000000 0 2011 91
3 0 1 0 0 1 249.000 0 0 0.0000000 0 2012 101
3 0 0 0 0 40 40.000 0 3 1.0000000 0 2012 102
3 0 0 1 1 0 0.000 0 0 0.0000000 0 2012 103
3 0 1 1 1 2 350.000 0 0 0.0000000 0 2012 104
3 1 0 1 0 8 1157.000 0 0 0.0000000 0 2012 105
3 0 1 0 0 3 512.000 0 0 0.0000000 0 2012 106
3 1 1 0 0 6 1114.000 0 0 0.0000000 0 2012 107
3 0 1 1 0 2 230.000 0 2 0.6666667 0 2012 108
2 1 1 1 0 1 4067.000 0 0 0.0000000 0 2013 117
2 1 1 0 0 5 2154.000 0 0 0.0000000 0 2013 118
2 0 0 0 0 1 420.000 0 1 0.5000000 0 2013 119
2 0 0 0 0 8 607.000 0 0 0.0000000 0 2013 120
2 0 1 0 0 1 131.000 0 0 0.0000000 0 2013 121
2 0 0 0 0 1 0.000 0 0 0.0000000 0 2013 122
2 0 1 0 0 5 50.000 0 3 1.5000000 0 2013 123
2 1 1 1 1 3 1281.000 0 3 1.5000000 0 2013 124
2 0 1 1 1 1 86.000 0 0 0.0000000 0 2013 127
1 0 0 1 0 12 0.000 0 0 0.0000000 0 2014 128
1 0 1 1 0 0 371.000 0 2 2.0000000 0 2014 129
1 1 1 1 1 0 3261.000 0 0 0.0000000 0 2014 130
1 1 1 1 0 0 6274.000 0 3 3.0000000 0 2014 131
0 0 1 1 1 0 256.000 0 0 0.0000000 0 2015 136
0 0 0 0 0 0 212.000 0 0 0.0000000 0 2015 137
36 0 1 0 0 0 0.000 0 1 0.0277778 0 1979 1
31 0 1 0 0 0 98.000 0 8 0.2580645 0 1984 4

install.packages(psych) Error in install.packages : ‘match’ requires vector arguments

Restarting R session…

install.packages(“psych”) Installing package into ‘/cloud/lib/x86_64-pc-linux-gnu-library/4.3’ (as ‘lib’ is unspecified) trying URL ‘http://rspm/default/__linux__/focal/latest/src/contrib/psych_2.3.12.tar.gz’ Content type ‘application/x-gzip’ length 4039922 bytes (3.9 MB) ================================================== downloaded 3.9 MB

The downloaded source packages are in ‘/tmp/RtmpuFtmV8/downloaded_packages’ > library(psych) > describe(DF) vars n mean sd median trimmed mad min PublicationYears 1 67 8.52 8.16 7.0 7.05 5.93 0 BigSample 2 67 0.27 0.45 0.0 0.22 0.00 0 Method 3 67 0.70 0.46 1.0 0.75 0.00 0 AngloSaxon 4 67 0.69 0.47 1.0 0.73 0.00 0 USA 5 67 0.45 0.50 0.0 0.44 0.00 0 TimeSpan 6 67 3.87 7.57 1.0 2.20 1.48 0 Sample 7 67 1755.17 6348.16 371.0 779.31 413.65 0 BusinessSupport 8 67 0.04 0.21 0.0 0.00 0.00 0 TC 9 67 22.52 46.55 3.0 10.87 4.45 0 TCYear 10 67 2.17 3.95 0.5 1.19 0.74 0 EXCLUDED 11 67 0.00 0.00 0.0 0.00 0.00 0 PY 12 67 2006.48 8.16 2008.0 2007.95 5.93 1979 Nr_Papieru 13 67 64.72 44.95 55.0 64.07 65.23 1 max range skew kurtosis se PublicationYears 36.00 36.00 1.80 3.10 1.00 BigSample 1.00 1.00 1.02 -0.97 0.05 Method 1.00 1.00 -0.86 -1.28 0.06 AngloSaxon 1.00 1.00 -0.79 -1.40 0.06 USA 1.00 1.00 0.21 -1.99 0.06 TimeSpan 40.00 40.00 3.67 13.88 0.92 Sample 51755.00 51755.00 7.29 54.45 775.55 BusinessSupport 1.00 1.00 4.30 16.78 0.03 TC 227.00 227.00 2.65 6.79 5.69 TCYear 18.92 18.92 2.48 5.70 0.48 EXCLUDED 0.00 0.00 NaN NaN 0.00 PY 2015.00 36.00 -1.80 3.10 1.00 Nr_Papieru 137.00 136.00 0.13 -1.49 5.49 > TCY<- lm(TCYear ~ PublicationYears +BigSample+ Method+AngloSaxon+TimeSpan +Sample+BusinessSupport,DF) > summary(TCY)

Call: lm(formula = TCYear ~ PublicationYears + BigSample + Method + AngloSaxon + TimeSpan + Sample + BusinessSupport, data = DF)

Residuals: Min 1Q Median 3Q Max -4.6610 -1.4347 -0.4097 0.3778 13.8215

Coefficients: Estimate Std. Error t value Pr(>|t|)
(Intercept) -1.085e+00 1.206e+00 -0.900 0.3718
PublicationYears 1.019e-01 5.645e-02 1.806 0.0760 . BigSample 3.583e+00 1.129e+00 3.173 0.0024 ** Method 6.020e-01 1.069e+00 0.563 0.5755
AngloSaxon 8.287e-01 1.027e+00 0.807 0.4231
TimeSpan 1.106e-01 6.237e-02 1.773 0.0815 . Sample -5.256e-05 7.557e-05 -0.696 0.4895
BusinessSupport 2.185e+00 2.184e+00 1.001 0.3212
— Signif. codes: 0 ‘’ 0.001 ‘’ 0.01 ‘’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 3.633 on 59 degrees of freedom Multiple R-squared: 0.2427, Adjusted R-squared: 0.1529 F-statistic: 2.701 on 7 and 59 DF, p-value: 0.01693

plot(TCY) Hit to see next plot: Hit to see next plot: Hit to see next plot: Hit to see next plot: Warning messages: 1: In sqrt(crit * p * (1 - hh)/hh) : NaNs produced 2: In sqrt(crit * p * (1 - hh)/hh) : NaNs produced hats <- hatvalues(TCY) plot(hats, type = ‘h’) hats <- as.data.frame(hatvalues(TCY)) hats hatvalues(TCY) 1 0.21290798 2 0.19167812 3 0.07835187 4 0.07988768 5 0.10611081 6 0.09475865 7 0.04597844 8 0.04404193 9 0.07201387 10 0.07308525 11 0.13581008 12 0.07100794 13 0.06762549 14 0.04526655 15 0.37665168 16 0.09072711 17 0.08400364 18 0.04133848 19 0.06246831 20 0.34292671 21 0.08739606 22 0.04062334 23 0.18367009 24 0.07222597 25 0.39530021 26 0.06844399 27 0.04191017 28 0.04291890 29 0.08724704 30 0.04695298 31 0.06736653 32 0.06529267 33 0.04571295 34 0.04351669 35 0.97998610 36 0.04362519 37 0.07036614 38 0.09122794 39 0.06180910 40 0.34836347 41 0.07183608 42 0.04735230 43 0.07554022 44 0.37576933 45 0.10478660 46 0.05068387 47 0.13679124 48 0.07345583 49 0.13162536 50 0.05073110 51 0.06632617 52 0.12817979 53 0.09669277 54 0.08084825 55 0.07821484 56 0.09649332 57 0.07595300 58 0.07221547 59 0.05541486 60 0.09904922 61 0.06116892 62 0.07186645 63 0.06992124 64 0.06570245 65 0.11032187 66 0.25670894 67 0.19575441 hats[order(-hats[‘hatvalues(TCY)’]), ] Error in xtfrm.data.frame(x) : cannot xtfrm data frames hats <- as.data.frame(hatvalues(TCY)) hats hatvalues(TCY) 1 0.21290798 2 0.19167812 3 0.07835187 4 0.07988768 5 0.10611081 6 0.09475865 7 0.04597844 8 0.04404193 9 0.07201387 10 0.07308525 11 0.13581008 12 0.07100794 13 0.06762549 14 0.04526655 15 0.37665168 16 0.09072711 17 0.08400364 18 0.04133848 19 0.06246831 20 0.34292671 21 0.08739606 22 0.04062334 23 0.18367009 24 0.07222597 25 0.39530021 26 0.06844399 27 0.04191017 28 0.04291890 29 0.08724704 30 0.04695298 31 0.06736653 32 0.06529267 33 0.04571295 34 0.04351669 35 0.97998610 36 0.04362519 37 0.07036614 38 0.09122794 39 0.06180910 40 0.34836347 41 0.07183608 42 0.04735230 43 0.07554022 44 0.37576933 45 0.10478660 46 0.05068387 47 0.13679124 48 0.07345583 49 0.13162536 50 0.05073110 51 0.06632617 52 0.12817979 53 0.09669277 54 0.08084825 55 0.07821484 56 0.09649332 57 0.07595300 58 0.07221547 59 0.05541486 60 0.09904922 61 0.06116892 62 0.07186645 63 0.06992124 64 0.06570245 65 0.11032187 66 0.25670894 67 0.19575441 hats[order(-hats[‘hatvalues(TCY)’]), ] Error in xtfrm.data.frame(x) : cannot xtfrm data frames hats <- hatvalues(TCY) plot(hats, type = ‘h’) hats[order(-hats[‘hatvalues(TCY)’]), ] Error in hats[order(-hats[“hatvalues(TCY)”]), ] : incorrect number of dimensions > plot(hats, type = ‘h’) Error: unexpected ‘>’ in “>” plot(hats, type = ‘h’)

cutoff <- 2 * (length(coef(TCY)) - 1) / length(hats) z <- hats > cutoff sum(z, na.rm = FALSE) [1] 8 cutoff <- 2*(6-1)/20

z <- hats > cutoff

sum(z, na.rm = FALSE) [1] 1

```