load packages

library(tidyverse)
Registered S3 methods overwritten by 'dbplyr':
  method         from
  print.tbl_lazy     
  print.tbl_sql      
── Attaching packages ────────────────────────────────── tidyverse 1.3.0 ──
✓ tibble  3.0.3     ✓ dplyr   1.0.2
✓ tidyr   1.1.2     ✓ stringr 1.4.0
✓ readr   1.4.0     ✓ forcats 0.5.0
✓ purrr   0.3.4     
── Conflicts ───────────────────────────────────── tidyverse_conflicts() ──
x dplyr::filter() masks stats::filter()
x dplyr::lag()    masks stats::lag()
library(psych)

Attaching package: ‘psych’

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

    %+%, alpha

import data

exam <- read_csv("Examdataset .csv")

── Column specification ───────────────────────────────────────────────────
cols(
  ability = col_double(),
  forceful = col_double(),
  analytic = col_double(),
  risky = col_double(),
  ambitious = col_double(),
  hilo = col_double(),
  group = col_double()
)

1 Descriptive Statistics

describe(exam)

summary exam

summary(exam)
    ability         forceful        analytic         risky      
 Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.000  
 1st Qu.:3.000   1st Qu.:3.000   1st Qu.:4.000   1st Qu.:3.000  
 Median :5.000   Median :4.000   Median :6.000   Median :4.000  
 Mean   :4.599   Mean   :3.951   Mean   :5.374   Mean   :4.171  
 3rd Qu.:6.000   3rd Qu.:5.000   3rd Qu.:7.000   3rd Qu.:5.000  
 Max.   :7.000   Max.   :7.000   Max.   :9.000   Max.   :7.000  
   ambitious          hilo            group      
 Min.   :1.000   Min.   :0.0000   Min.   :1.000  
 1st Qu.:4.000   1st Qu.:0.0000   1st Qu.:2.000  
 Median :5.000   Median :0.0000   Median :3.000  
 Mean   :5.054   Mean   :0.4661   Mean   :2.545  
 3rd Qu.:6.000   3rd Qu.:1.0000   3rd Qu.:4.000  
 Max.   :7.000   Max.   :1.0000   Max.   :4.000  

2 boxplots to describe “risky” in each group

ggplot(exam, aes(risky)) + geom_boxplot() + facet_wrap(~group)

box plots forceful by risky

ggplot(exam, aes(forceful, risky, group = group)) + geom_boxplot() + facet_wrap(~group)

3 scatter plot forceful by risky, using facet wrap

ggplot(exam,aes(x=forceful,y=risky)) + geom_jitter() + facet_wrap(~group)

visualize scatter plot

ggplot(exam,aes(x=forceful,y=risky)) + geom_point() + facet_wrap(~group)

  scale_x_log10()+
Error: Incomplete expression:   scale_x_log10()+

4 import data, Examdataset2

exam2 <- read.csv("Examdataset2.csv")

5 boxplot of rash for entire data set

boxplot(exam2$rash)

boxplot of rash for entire data set using ggplot

ggplot(exam2, aes(rash)) + geom_boxplot()

6 correlations of all variables in Examdataset2

cor(exam2)
               ability    forceful     analytic       risky   ambitious
ability    1.000000000  0.42168091  0.204126413  0.31743910  0.34628805
forceful   0.421680908  1.00000000  0.198085624  0.24070903  0.15246447
analytic   0.204126413  0.19808562  1.000000000  0.14481002  0.17793936
risky      0.317439098  0.24070903  0.144810017  1.00000000  0.33825219
ambitious  0.346288045  0.15246447  0.177939364  0.33825219  1.00000000
hilo       0.003061461 -0.01782069  0.009375494  0.01189650 -0.03999187
group     -0.034837121 -0.05927937 -0.035917312 -0.03375605 -0.02795151
rash       0.470168258  0.79480488  0.218169248  0.78033832  0.30972500
                  hilo       group         rash
ability    0.003061461 -0.03483712  0.470168258
forceful  -0.017820692 -0.05927937  0.794804879
analytic   0.009375494 -0.03591731  0.218169248
risky      0.011896502 -0.03375605  0.780338317
ambitious -0.039991868 -0.02795151  0.309724996
hilo       1.000000000  0.15560199 -0.004043627
group      0.155601994  1.00000000 -0.059299739
rash      -0.004043627 -0.05929974  1.000000000

descriptive statistics exam2

describe(exam2)

correlations exam2

cor(exam2)
               ability    forceful     analytic       risky   ambitious
ability    1.000000000  0.42168091  0.204126413  0.31743910  0.34628805
forceful   0.421680908  1.00000000  0.198085624  0.24070903  0.15246447
analytic   0.204126413  0.19808562  1.000000000  0.14481002  0.17793936
risky      0.317439098  0.24070903  0.144810017  1.00000000  0.33825219
ambitious  0.346288045  0.15246447  0.177939364  0.33825219  1.00000000
hilo       0.003061461 -0.01782069  0.009375494  0.01189650 -0.03999187
group     -0.034837121 -0.05927937 -0.035917312 -0.03375605 -0.02795151
rash       0.470168258  0.79480488  0.218169248  0.78033832  0.30972500
                  hilo       group         rash
ability    0.003061461 -0.03483712  0.470168258
forceful  -0.017820692 -0.05927937  0.794804879
analytic   0.009375494 -0.03591731  0.218169248
risky      0.011896502 -0.03375605  0.780338317
ambitious -0.039991868 -0.02795151  0.309724996
hilo       1.000000000  0.15560199 -0.004043627
group      0.155601994  1.00000000 -0.059299739
rash      -0.004043627 -0.05929974  1.000000000

7 linear regression, forceful to predict rash

attach(exam2)
The following objects are masked from exam2 (pos = 3):

    ability, ambitious, analytic, forceful, group, hilo, rash, risky

The following objects are masked from exam2 (pos = 4):

    ability, ambitious, analytic, forceful, group, hilo, rash, risky

The following objects are masked from exam2 (pos = 5):

    ability, ambitious, analytic, forceful, group, hilo, rash, risky

The following objects are masked from exam2 (pos = 6):

    ability, ambitious, analytic, forceful, group, hilo, rash, risky

The following objects are masked from exam2 (pos = 7):

    ability, ambitious, analytic, forceful, group, hilo, rash, risky

The following objects are masked from exam2 (pos = 8):

    ability, ambitious, analytic, forceful, group, hilo, rash, risky

The following objects are masked from exam2 (pos = 9):

    ability, ambitious, analytic, forceful, group, hilo, rash, risky

The following objects are masked from exam2 (pos = 12):

    ability, ambitious, analytic, forceful, group, hilo, rash, risky

The following objects are masked from exam (pos = 13):

    ability, ambitious, analytic, forceful, group, hilo, risky

The following objects are masked from exam2 (pos = 19):

    ability, ambitious, analytic, forceful, group, hilo, rash, risky

The following objects are masked from exam (pos = 20):

    ability, ambitious, analytic, forceful, group, hilo, risky

The following objects are masked from exam (pos = 21):

    ability, ambitious, analytic, forceful, group, hilo, risky

The following objects are masked from exam (pos = 22):

    ability, ambitious, analytic, forceful, group, hilo, risky

The following objects are masked from exam2 (pos = 23):

    ability, ambitious, analytic, forceful, group, hilo, rash, risky

The following objects are masked from exam2 (pos = 33):

    ability, ambitious, analytic, forceful, group, hilo, rash, risky

The following objects are masked from exam2 (pos = 34):

    ability, ambitious, analytic, forceful, group, hilo, rash, risky

The following objects are masked from exam2 (pos = 35):

    ability, ambitious, analytic, forceful, group, hilo, rash, risky

The following objects are masked from exam (pos = 36):

    ability, ambitious, analytic, forceful, group, hilo, risky
lr <- lm(forceful~ rash)
summary(lr)

Call:
lm(formula = forceful ~ rash)

Residuals:
     Min       1Q   Median       3Q      Max 
-2.88877 -0.42505  0.08704  0.62333  3.11123 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept) -0.20798    0.17440  -1.193    0.234    
rash         1.02419    0.04082  25.090   <2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 1.041 on 367 degrees of freedom
Multiple R-squared:  0.6317,    Adjusted R-squared:  0.6307 
F-statistic: 629.5 on 1 and 367 DF,  p-value: < 2.2e-16

regression graph

ggplot(exam2, aes(x=forceful, y=rash)) + geom_point() + geom_jitter() + geom_smooth(method="lm")

instal EpiDisplay

install.packages("epiDisplay")
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/epiDisplay_3.5.0.1.tgz'
Content type 'application/x-gzip' length 660576 bytes (645 KB)
==================================================
downloaded 645 KB

The downloaded binary packages are in
    /var/folders/0t/jr6fgwg97214m2gdnbw5pbw40000gn/T//RtmpPWkYVu/downloaded_packages

library epiDisplay

library(epiDisplay)
Loading required package: foreign
Loading required package: survival
Loading required package: MASS

Attaching package: ‘MASS’

The following object is masked from ‘package:dplyr’:

    select

Loading required package: nnet

Attaching package: ‘epiDisplay’

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

    alpha, cs, lookup

The following object is masked from ‘package:ggplot2’:

    alpha

instal packages

install.packages("ppcor")
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/ppcor_1.1.tgz'
Content type 'application/x-gzip' length 27757 bytes (27 KB)
==================================================
downloaded 27 KB

The downloaded binary packages are in
    /var/folders/0t/jr6fgwg97214m2gdnbw5pbw40000gn/T//RtmpPWkYVu/downloaded_packages
install.packages("apaTables")
also installing the dependencies ‘matrixStats’, ‘RcppArmadillo’, ‘zip’, ‘SparseM’, ‘MatrixModels’, ‘conquer’, ‘sp’, ‘data.table’, ‘openxlsx’, ‘minqa’, ‘nloptr’, ‘statmod’, ‘RcppEigen’, ‘carData’, ‘abind’, ‘pbkrtest’, ‘quantreg’, ‘maptools’, ‘rio’, ‘lme4’, ‘car’

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/matrixStats_0.57.0.tgz'
Content type 'application/x-gzip' length 2005921 bytes (1.9 MB)
==================================================
downloaded 1.9 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/RcppArmadillo_0.9.900.3.0.tgz'
Content type 'application/x-gzip' length 1871293 bytes (1.8 MB)
==================================================
downloaded 1.8 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/zip_2.1.1.tgz'
Content type 'application/x-gzip' length 211635 bytes (206 KB)
==================================================
downloaded 206 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/SparseM_1.78.tgz'
Content type 'application/x-gzip' length 1096472 bytes (1.0 MB)
==================================================
downloaded 1.0 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/MatrixModels_0.4-1.tgz'
Content type 'application/x-gzip' length 449286 bytes (438 KB)
==================================================
downloaded 438 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/conquer_1.0.2.tgz'
Content type 'application/x-gzip' length 872031 bytes (851 KB)
==================================================
downloaded 851 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/sp_1.4-4.tgz'
Content type 'application/x-gzip' length 1932488 bytes (1.8 MB)
==================================================
downloaded 1.8 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/data.table_1.13.0.tgz'
Content type 'application/x-gzip' length 2306488 bytes (2.2 MB)
==================================================
downloaded 2.2 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/openxlsx_4.2.2.tgz'
Content type 'application/x-gzip' length 3028905 bytes (2.9 MB)
==================================================
downloaded 2.9 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/minqa_1.2.4.tgz'
Content type 'application/x-gzip' length 341728 bytes (333 KB)
==================================================
downloaded 333 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/nloptr_1.2.2.2.tgz'
Content type 'application/x-gzip' length 945144 bytes (922 KB)
==================================================
downloaded 922 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/statmod_1.4.34.tgz'
Content type 'application/x-gzip' length 270712 bytes (264 KB)
==================================================
downloaded 264 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/RcppEigen_0.3.3.7.0.tgz'
Content type 'application/x-gzip' length 4852649 bytes (4.6 MB)
==================================================
downloaded 4.6 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/carData_3.0-4.tgz'
Content type 'application/x-gzip' length 1819549 bytes (1.7 MB)
==================================================
downloaded 1.7 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/abind_1.4-5.tgz'
Content type 'application/x-gzip' length 61580 bytes (60 KB)
==================================================
downloaded 60 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/pbkrtest_0.4-8.6.tgz'
Content type 'application/x-gzip' length 272056 bytes (265 KB)
==================================================
downloaded 265 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/quantreg_5.73.tgz'
Content type 'application/x-gzip' length 1585756 bytes (1.5 MB)
==================================================
downloaded 1.5 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/maptools_1.0-2.tgz'
Content type 'application/x-gzip' length 2173904 bytes (2.1 MB)
==================================================
downloaded 2.1 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/rio_0.5.16.tgz'
Content type 'application/x-gzip' length 503445 bytes (491 KB)
==================================================
downloaded 491 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/lme4_1.1-23.tgz'
Content type 'application/x-gzip' length 7928269 bytes (7.6 MB)
==================================================
downloaded 7.6 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/car_3.0-10.tgz'
Content type 'application/x-gzip' length 1561683 bytes (1.5 MB)
==================================================
downloaded 1.5 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/apaTables_2.0.5.tgz'
Content type 'application/x-gzip' length 998481 bytes (975 KB)
==================================================
downloaded 975 KB

The downloaded binary packages are in
    /var/folders/0t/jr6fgwg97214m2gdnbw5pbw40000gn/T//RtmpPWkYVu/downloaded_packages
library(ppcor)
library(apaTables)

7 Regression table and answer for intercept and slope

apa.reg.table(lr,filename = "Table1.doc",table.number = 1)

MBESS package needs to be installed to calculate R2 confidence intervals.


Table 1 

Regression results using forceful as the criterion
 

Note. A significant b-weight indicates the beta-weight and semi-partial correlation are also significant.
b represents unstandardized regression weights. beta indicates the standardized regression weights. 
sr2 represents the semi-partial correlation squared. r represents the zero-order correlation.
Square brackets are used to enclose the lower and upper limits of a confidence interval.
* indicates p < .05. ** indicates p < .01.
 

Y = a + bX predicted value of rash = predicted value of rash if forceful is 0 + slope(forceful)

intercept = -0.21, when forceful is 0 rash is -0.21 slope = for every 1 unit increase in forceful, we expect to see a 1.02 increase in rash

8 frequency table that uses group to define rows and liklihood that people will be interested in being leaders (hilo) to define columns

library(epiDisplay)
tab1(exam2$group,hilo = TRUE)
exam2$group : 
        Frequency Percent Cum. percent
1              89    24.1         24.1
2              90    24.4         48.5
3              90    24.4         72.9
4             100    27.1        100.0
  Total       369   100.0        100.0

9 liklihood that people will be interested in being leaders (hilo) is independent of group – sig test and strength of relationship

obsf <- matrix(c(89,90,90,100), nrow = 4, ncol = 1, byrow = TRUE)
obsf
     [,1]
[1,]   89
[2,]   90
[3,]   90
[4,]  100
exf <- matrix(c(92.25,92.25,92.25,92.25), nrow = 4, ncol = 1, byrow = TRUE)
exf
      [,1]
[1,] 92.25
[2,] 92.25
[3,] 92.25
[4,] 92.25
chisq.test(obsf)

    Chi-squared test for given probabilities

data:  obsf
X-squared = 0.87534, df = 3, p-value = 0.8314

install DescTools

install.packages("DescTools")
library(DescTools)

ContCoef(obsf)

ContCoef(obsf)
[1] 0.04864748

10

obsf10 <- matrix(c(89,90), nrow = 2, ncol = 1, byrow = TRUE)
obsf10
     [,1]
[1,]   89
[2,]   90
chisq.test(obsf10)

    Chi-squared test for given probabilities

data:  obsf10
X-squared = 0.0055866, df = 1, p-value = 0.9404
ContCoef(obsf10)
[1] 0.005586505

11 odds ratio from #10

#install.packages("epitools")
library(epitools)
library(DescTools)

obsf11 <- matrix(c(89,92.25,92.25,90), nrow = 2, ncol = 2)
obsf11
      [,1]  [,2]
[1,] 89.00 92.25
[2,] 92.25 90.00
oddsratio.wald(obsf11)
'x' has been rounded to integer: Mean relative difference: 0.002710027'x' has been rounded to integer: Mean relative difference: 0.002710027'x' has been rounded to integer: Mean relative difference: 0.002710027
$data
          Outcome
Predictor  Disease1 Disease2  Total
  Exposed1    89.00    92.25 181.25
  Exposed2    92.25    90.00 182.25
  Total      181.25   182.25 363.50

$measure
          odds ratio with 95% C.I.
Predictor   estimate     lower    upper
  Exposed1 1.0000000        NA       NA
  Exposed2 0.9412387 0.6238711 1.420053

$p.value
          two-sided
Predictor  midp.exact fisher.exact chi.square
  Exposed1         NA           NA         NA
  Exposed2  0.7940299    0.8339695  0.7728699

$correction
[1] FALSE

attr(,"method")
[1] "Unconditional MLE & normal approximation (Wald) CI"

We can be 95% confident that group, predicts hilo.

LS0tCnRpdGxlOiAiUiBOb3RlYm9vayAtLSBleGFtIgpvdXRwdXQ6IAogIGh0bWxfbm90ZWJvb2s6CiAgICB0b2M6IHllcwotLS0KCiMgbG9hZCBwYWNrYWdlcyAKYGBge3J9CmxpYnJhcnkodGlkeXZlcnNlKQpgYGAKYGBge3J9CmxpYnJhcnkocHN5Y2gpCmBgYAojIGltcG9ydCBkYXRhIApgYGB7cn0KZXhhb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