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
    
  
  
    
  | # The code is based on: | |
| # Arend, M. G., & Schäfer, T. (2019). Statistical power in two-level models: A tutorial based on Monte Carlo simulation. | |
| # Psychological Methods, 24(1), 1–19. https://doi.org/10.1037/met0000195 | |
| alpha = 0.05 # significance level | |
| nL1 = 3 # average number of observations per person (actual = 3.8) | |
| nL2 = 100 # number of persons | |
| effect = 0.1 # small, 0.3 medium, 0.5 large effect | |
| ICC = 0.1 | 
  
    
      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
    
  
  
    
  | # Calculate the likelihood ratio between Hypotheses---- | |
| options(scipen=9999) | |
| n <- 3 # number of experiments | |
| x <- 0:3 # number of successes | |
| ## probability of finding a significant result | |
| H0 <- 0.05 # = alpha | 
  
    
      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
    
  
  
    
  | ## Junior Researcher Programme 2017 | |
| ## Project: From Identity Leadership to Work Commitment | |
| ## Simulation of data and associated syntax for planned analysis | |
| # Packages ---------------------------------------------------------------- | |
| # Check if packages are installed, if not install and load them |