This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library("dlstats") | |
library("ggplot2") | |
pack <- cran_stats(c("metafor", "meta", "rmeta", "psychmeta")) | |
if (!is.null(pack)) { | |
print(head(pack)) | |
ggplot(pack, aes(end, downloads, group=package, color=package)) + | |
geom_line() + | |
geom_point() + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
install.packages("europepmc") | |
install.packages("cowplot") | |
install.packages("tidyverse") | |
library(europepmc) | |
library(cowplot) | |
library(tidyverse) | |
svb_trend <- europepmc::epmc_hits_trend(query = "sympathovagal balance", | |
period = 2008:2021) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
install.packages("europepmc") | |
install.packages("cowplot") | |
install.packages("tidyverse") | |
library(europepmc) | |
library(cowplot) | |
library(tidyverse) | |
hrv_trend <- europepmc::epmc_hits_trend(query = "heart rate variability", | |
period = 1978:2018) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
library(synthpop) | |
library(DT) | |
ui <- fluidPage( | |
titlePanel("Creating synthetic data"), | |
sidebarLayout( | |
sidebarPanel( | |
p("This is an application that creates default data synthesis using the 'synthpop' package. Upload some data and inspect the synthesized data. Your file must be in csv format to upload."), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> help_glm_h <- lm(happy_o ~ 1 + drugcond + | |
emocond + drugcond:emocond, | |
data = h_dat) # Model from observed data | |
> help_syn_glm_h <- lm.synds(happy_o ~ 1 + drugcond + | |
emocond + drugcond:emocond, | |
data = h_dat_s) # Model from synthesized data | |
> compare(help_syn_glm_h, h_dat) # A comparison of the models |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
h_dat_s <- syn(h_dat, m = 1, seed = 1969) | |
compare(h_dat_s, h_dat, | |
stat = "counts", # Selecting counts instead of percentage | |
cols = c("#62B6CB", "#1B4965")) # Changing colours |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> m1 = lm(happy_o ~ 1 + drugcond + emocond, | |
data = h_dat) # Model 1 with main effects only | |
> m2 = lm(happy_o ~ 1 + drugcond + emocond + | |
drugcond:emocond, data = h_dat) # Model with main effects and interaction | |
> summary(m2) # Summary of model 2 (with same p-value as original ANOVA for the interaction) | |
Call: | |
lm(formula = happy_o ~ 1 + drugcond + emocond + drugcond:emocond, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> summary(aov(happy_o ~drugcond*emocond,data=h_dat)) # Interaction effect on happiness | |
Df Sum Sq Mean Sq F value Pr(>F) | |
drugcond 1 1.70 1.70 1.436 0.2352 | |
emocond 1 34.21 34.21 28.950 1.16e-06 *** | |
drugcond:emocond 1 4.40 4.40 3.726 0.0581 . | |
Residuals 63 74.44 1.18 | |
--- | |
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 | |
49 observations deleted due to missingness |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(synthpop) | |
library(tidyverse) | |
library(cowplot) | |
h_dat <- read_csv("help.csv") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
install.packages("europepmc") | |
install.packages("cowplot") | |
install.packages("tidyverse") | |
library(europepmc) | |
library(cowplot) | |
library(tidyverse) | |
ot_trend <- europepmc::epmc_hits_trend(query = "oxytocin", | |
period = 2008:2018) |
NewerOlder