Skip to content

Commit

Permalink
Ready for release
Browse files Browse the repository at this point in the history
  • Loading branch information
heinonmatti committed Apr 4, 2019
1 parent 5cb314a commit 218e3b0
Show file tree
Hide file tree
Showing 1,523 changed files with 18,977 additions and 3,612 deletions.
8 changes: 5 additions & 3 deletions _baseline-manuscript.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ This study analyses baseline data from a cluster-randomised controlled trial tes

Six school units were included in the study. There were four educational tracks in the schools from which students were recruited: 1. Practical Nurse (Nur), 2. Hotel, Restaurant and Catering (HRC), 3. Business and Administration (BA), and 4. Information and Communications Technology (IT). Schools were paired so that there would be matching numbers of students from each educational track for both members of the pair. Blinded randomisation by a statistician was then conducted so that a random member of each pair was selected as intervention school, the other as control school (details reported in @hankonenLetMoveIt2016). Student participants were blind to allocation at baseline.

All conducted analyses and visualisations with accompanying code, can be found in the supplementary website at https://git.io/fNHuf (permalink at [REF]), previously piloted in [@heinoSimpleRationaleprovidingSMS2018]. Source code to reproduce this manuscript and all its figures can be found at https://git.io/fptcC.
All conducted analyses and visualisations with accompanying code, can be found in the supplementary website at https://git.io/fNHuf (permalink at [REF]), previously piloted in [@heinoSimpleRationaleprovidingSMS2018]. Source code to reproduce this manuscript (written with the R package `papaja` [@austPapajaPreparingAPA2019]), and all its figures can be found at https://git.io/fptcC.

<!-- TODO right before submission -->

Expand All @@ -133,7 +133,7 @@ In the LMI trial, there were multiple primary outcomes. The primary outcome for

### Theoretical predictors of PA

The determinants postulated by the program theory included behavioural beliefs (outcome expectations, descriptive norms, intention, self-efficacy/perceived behavioural control), autonomous and controlled motivation, opportunities, action- and coping planning, and behaviour change technique (BCT) use. Participants were allowed to skip questions, and scales were computed as means of all items where responses were available. In other words, answering a single item of a specific scale sufficed. All items, response options, and descriptive statistics of scales are available in the supplementary website (section https://git.io/fAj0e); made using R package `codebook` @arslanHowAutomaticallyDocument for automatic dataset documentation.
The determinants postulated by the program theory included behavioural beliefs (outcome expectations, descriptive norms, intention, self-efficacy/perceived behavioural control), autonomous and controlled motivation, opportunities, action- and coping planning, and behaviour change technique (BCT) use. Participants were allowed to skip questions, and scales were computed as means of all items where responses were available. In other words, answering a single item of a specific scale sufficed. All items, response options, and descriptive statistics of scales are available in the supplementary website (section https://git.io/fAj0e); made using R package `codebook` [@arslanHowAutomaticallyDocument] for automatic dataset documentation.

### Statistical analysis

Expand Down Expand Up @@ -1101,7 +1101,9 @@ In conclusion, this analysis of baseline data from the Let's Move It interventio

### List of abbreviations

\noindent PA = Physical activity
\noindent

PA = Physical activity
MVPA = Moderate-to-vigorous physical activity
SB = Sedentary behaviour
BCT = Behaviour change technique
Expand Down
2 changes: 1 addition & 1 deletion baseline-datasetup.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ knitr::opts_chunk$set(echo = TRUE,
warning = FALSE,
message = FALSE,
error = TRUE,
cache = TRUE,
cache = FALSE,
collapse = TRUE,
eval = TRUE,
dpi = 300)
Expand Down
119 changes: 24 additions & 95 deletions baseline-networks.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,97 +4,14 @@ title: "Network analyses"

This section describes network analyses and displays correlation structures in the data. Here, physical activity (PA) is used interchangeably with moderate-to-vigorous physical activity (MVPA); all measures of activity relate to MVPA.

```{r htmlTemp3, echo=FALSE, eval=FALSE, INCLUDE = FALSE}
# This chunk was an attempt at html_document2 with code folding... Turned out to be a bit much.
codejs <- readr::read_lines("/mnt/Data/autoentrepreneur/js/codefolding.js")
collapsejs <- readr::read_lines("/mnt/Data/autoentrepreneur/js/collapse.js")
transitionjs <- readr::read_lines("/mnt/Data/autoentrepreneur/js/transition.js")
dropdownjs <- readr::read_lines("/mnt/Data/autoentrepreneur/js/dropdown.js")
htmlhead <- c(
paste('
<script>',
paste(transitionjs, collapse = "\n"),
'</script>
<script>',
paste(collapsejs, collapse = "\n"),
'</script>
<script>',
paste(codejs, collapse = "\n"),
'</script>
<script>',
paste(dropdownjs, collapse = "\n"),
'</script>
<style type="text/css">
.code-folding-btn { margin-bottom: 4px; }
.row { display: flex; }
.collapse { display: none; }
.in { display:block }
.pull-right > .dropdown-menu {
right: 0;
left: auto;
}
.open > .dropdown-menu {
display: block;
}
.dropdown-menu {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 160px;
padding: 5px 0;
margin: 2px 0 0;
font-size: 14px;
text-align: left;
list-style: none;
background-color: #fff;
-webkit-background-clip: padding-box;
background-clip: padding-box;
border: 1px solid #ccc;
border: 1px solid rgba(0,0,0,.15);
border-radius: 4px;
-webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175);
box-shadow: 0 6px 12px rgba(0,0,0,.175);
}
</style>
<script>
$(document).ready(function () {
window.initializeCodeFolding("show" === "hide");
});
</script>
', sep = "\n"),
paste0('
<script>
document.write(\'<div class="btn-group pull-right" style="position: absolute; top: 20%; right: 2%; z-index: 200"><button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" data-_extension-text-contrast=""><span>Code</span> <span class="caret"></span></button><ul class="dropdown-menu" style="min-width: 50px;"><li><a id="rmd-show-all-code" href="#">Show All Code</a></li><li><a id="rmd-hide-all-code" href="#">Hide All Code</a></li></ul></div>\')
</script>
')
)
readr::write_lines(htmlhead, path = "/mnt/Data/autoentrepreneur/header.html")
```


```{r setup}
knitr::opts_chunk$set(
warning = FALSE, # show warnings during codebook generation
message = FALSE, # show messages during codebook generation
error = TRUE, # do not interrupt codebook generation in case of errors,
# usually makes debugging easier, and sometimes half a codebook
# is better than none
echo = FALSE, # don't show the R code,
cache = FALSE
)
```{r setup, message = FALSE, warning = FALSE}
source("baseline-datasetup.R")
```

Clicking the "Code"-buttons on the right shows code for each chunk.

$~$
$~$
<a id="network"></a>
Expand Down Expand Up @@ -4756,7 +4673,7 @@ plot(bootnet_centrality_stability_determinants, perNode=T, "strength")
bootnet::corStability(bootnet_centrality_stability_determinants)
```

### PA network without SDT motivations
<!-- ### PA network without SDT motivations -->

```{r, include = FALSE, eval = FALSE}
# Network without motivation variables
Expand Down Expand Up @@ -4790,7 +4707,7 @@ plot(network1, layout = "spring", labels = TRUE, groups = group.spinglass, color
```

### PA network without BCTs and SDT
<!-- ### PA network without BCTs and SDT -->

```{r, include = FALSE, eval = FALSE}
# Network without motivation variables
Expand Down Expand Up @@ -4847,7 +4764,7 @@ plot(nwBoys, label.scale = FALSE, title = "Boys", label.cex = 0.75,
pieBorder = 1)
```

### PA network without BCTs and SDT, intention, MVPA, fat%
<!-- ### PA network without BCTs and SDT, intention, MVPA, fat% -->

```{r, include = FALSE, eval = FALSE}
# Network without motivation variables
Expand Down Expand Up @@ -4895,7 +4812,7 @@ plot(network1, layout = "spring", labels = TRUE, groups = group.spinglass, color
```

## Robustness test
<!-- ## Robustness test -->

```{r, include = FALSE, eval = FALSE}
Expand All @@ -4917,7 +4834,7 @@ qgraph::centralityPlot(Network)
qgraph::centralityPlot(Network2)
```

## Centrality stability
<!-- ## Centrality stability -->

```{r, eval = FALSE}
boot2 <- bootnet::bootnet(Network1, nBoots = 2500, type = "case", nCores = 2)
Expand All @@ -4934,7 +4851,7 @@ plot(boot1, "betweenness")
plot(boot1, "closeness")
```

## Network comparison test: girls and boys
<!-- ## Network comparison test: girls and boys -->

```{r, include = FALSE, eval = FALSE}
Expand Down Expand Up @@ -4972,8 +4889,9 @@ sum(nct_results$einv.pvals$"p-value" < 0.05) # how many edges are different
```

## Robustness test
```{r, eval = FALSE}
<!-- ## Robustness test -->

```{r, include = FALSE, eval = FALSE}
data <- data %>% dplyr::select(BCT = agreementDependentBCT_T1,
AUT = autonomous_T1,
Intn = intention_T1,
Expand All @@ -4998,9 +4916,9 @@ qgraph::centralityPlot(Network)
qgraph::centralityPlot(Network2)
```

# Centrality stability
<!-- # Centrality stability -->

```{r, eval = FALSE}
```{r, include = FALSE, eval = FALSE}
boot2 <- bootnet::bootnet(Network, nBoots = 2500, type = "case", nCores = 2)
bootnet::corStability(boot2)
Expand Down Expand Up @@ -5227,9 +5145,20 @@ itemGroups <- c(rep("Amotivation", 4),
rep("Integrated", 3),
rep("Intrinsic", 3))
```

```{r sdt-network-all}
plot(nwAll, groups = itemGroups, nodeNames = itemNames, legend.cex = 0.25)
```

# Session information

Description of the R environment can be found below.

```{r session-info, results = 'markup'}
devtools::session_info()
pander::pander(sessionInfo())
```
2 changes: 0 additions & 2 deletions baseline-networks_cache/html/__packages
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,3 @@ dplyr
stringr
forcats
ggridges
shiny
corrgram
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified baseline-networks_files/figure-html/cognitiveBCTs1-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified baseline-networks_files/figure-html/cognitiveBCTs2-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified baseline-networks_files/figure-html/cognitiveBCTs3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified baseline-networks_files/figure-html/cognitiveBCTs4-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified baseline-networks_files/figure-html/exercisetypes-mgm-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified baseline-networks_files/figure-html/exercisetypes-mgm-CV-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified baseline-networks_files/figure-html/network-plot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified baseline-networks_files/figure-html/unnamed-chunk-2-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified baseline-networks_files/figure-html/unnamed-chunk-3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion baseline-supplement.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
title: "Descriptive plots"
output:
html_document:
keep_md: yes
---

```{r include = FALSE, eval = FALSE, echo = FALSE}
Expand Down Expand Up @@ -96,7 +99,7 @@ readr::write_lines(htmlhead, path = "/mnt/Data/autoentrepreneur/header.html")

Clicking the "Code"-buttons on the right shows code for each chunk.

To start data analysis, we run a data compilation file to enable compiling the document. This file can be found under the tab "Data setup code" on top of the screen.
To start data analysis, we run a data compilation file to enable compiling the document. This file can be found [here](https://raw.githubusercontent.com/heinonmatti/baseline-visu/master/baseline-datasetup.R).

```{r setup, verbose = FALSE, warning = FALSE, message = FALSE}
Expand Down Expand Up @@ -6370,4 +6373,10 @@ plot1 + plot2
```

# Session information

Description of the R environment can be found below.

```{r session-info, results = 'markup'}
devtools::session_info()
```
Loading

0 comments on commit 218e3b0

Please sign in to comment.