APA_: APA Syle Table

Description Usage Arguments Value Examples

Description

APA_ICC:Intra-Klassen-Korrelation (mit psych).

APA_Ttest: Berechnung von Mittelwerten und Mittelwertdifferenzen und des T-Test.

APA_Correlation: Korrelationstabelle (Interkorrelationen mit der Hilfe der Funktion Hmisc::rcorr. Erlaubt ist die getrennte Auswertung ueber by=~b

Wird in APA2 verwendet Tabelle Arbeitet mit Multi2default() und hat anderen Rueckgabewert als Tabelle (Mittelverte vs String)

APA_PCA: Faktoranalyse wie SPSS PCA

APA_R2: R2-Tabelle (noch nicht fretig)

Kreuztabellen cross-tabulation, APA_Xtabs, APA2.xtabs : Die Funktion Formatiert xtabs() mit NxM und NxMxO Tabellen.

Usage

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
APA_ICC(
  ...,
  caption = "ICC",
  note = "",
  type = c(1, 4),
  output = which_output()
)

APA_Ttest(
  x,
  data,
  caption = "T Test",
  note = paste(type, alternative),
  output = stp25output::which_output(),
  var.equal = FALSE,
  paired = FALSE,
  alternative = "two.sided",
  include.mean = TRUE,
  include.d = TRUE,
  include.mean.diff = TRUE,
  include.se = FALSE,
  include.n = FALSE,
  type = "t.test",
  digits = 2,
  random = NULL,
  ...
)

APA_Correlation(
  ...,
  caption = "Korrelation",
  note = "",
  output = which_output(),
  col_names = NULL,
  cor_diagonale_up = TRUE,
  type = c("pearson", "spearman"),
  include.mean = FALSE,
  include.n = TRUE,
  stars = TRUE,
  p.value = FALSE,
  include.stars = stars,
  include.p = p.value
)

Hmisc_rcorr(
  ...,
  cor_diagonale_up = TRUE,
  include.stars = TRUE,
  include.p = FALSE,
  include.mean = FALSE,
  include.n = TRUE,
  type = c("pearson", "spearman"),
  caption = "",
  note = ""
)

APA_NULL(x, ...)

APA_Likert(...)

APA2_multiresponse(
  Formula,
  data,
  caption = "",
  note = "",
  test = FALSE,
  order = FALSE,
  decreasing = TRUE,
  sig_test = "fischer.test",
  na.action = na.pass,
  use.level = 1,
  output = which_output(),
  ...
)

APA_PCA(
  data,
  ...,
  include.pca = TRUE,
  include.loading = include.pca,
  include.test = include.pca,
  include.plot = FALSE,
  include.kmo = TRUE,
  w = 5,
  h = 5,
  opene_graphic_device = FALSE,
  save_graphic = opene_graphic_device,
  caption = "Standardized loadings (pattern matrix) based upon correlation matrix",
  note = "",
  output = which_output(),
  main = ""
)

APA_Reliability(..., caption = "", note = "", output = which_output())

APA_R2(..., caption, note)

APA_Xtabs(x, ...)

## S3 method for class 'glm'
APA_Xtabs(
  x,
  caption = "",
  output = stp25output::which_output(),
  thresh = 0.5,
  ...
)

## S3 method for class 'formula'
APA_Xtabs(
  x,
  data = NULL,
  caption = "",
  note = "",
  output = stp25output::which_output(),
  labels = TRUE,
  addNA = FALSE,
  exclude = if (!addNA) c(NA, NaN),
  drop.unused.levels = FALSE,
  ...
)

## S3 method for class 'xtabs'
APA_Xtabs(x, ...)

## Default S3 method:
APA_Xtabs(x, ...)

Arguments

...

extra arguments

caption, note

Ueberschrift an Output

type

enweder "pearson" oder "spearman"

output

Html oder Text

x

An object to be converted into a tidy data.frame or Formula

data

data.frame wenn x eine Formel ist

var.equal, paired, alternative

an t.Test var.equal = FALSE "two.sided"

include.mean

Mittelwerte

include.d

Cohens d

include.mean.diff

Mittlere Differenzen

include.se

Standardfehler noch nicht Fertig

include.n

Anzahl an gueltigen Werten

digits

Nachkommastellen

random

formula bei paired muss zwingend eine eindeutige id oder Fallnummer vorhanden sein

col_names

nicht benutzt

cor_diagonale_up

Diagonale oben oder unter

include.stars

Sternchen als p-Werte

include.p

Explizite p-Werte

Formula, test, order, decreasing, sig_test, na.action

Interne Parameter

include.pca, include.loading, include.test, include.plot, include.kmo

was soll ausgegeben werden

w, h, main, opene_graphic_device, save_graphic

Fenster w=5 h=5 Ueberschrift

addNA, exclude, drop.unused.levels

An xtabs() default = FALSE

Value

a data.frame or list with data.frame

Examples

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
 

 

APA_Ttest(m1+m2 ~ geschl, varana)
varanax<-Melt2(m1+m2~nr,varana , key="time", value="m")

# broom::tidy(with(varana, t.test(m1,m2 ) ))
# broom::tidy(  t.test(m~time, varanax, var.equal=FALSE)) )

APA_Ttest(m~time, varanax, paired = TRUE)



APA_Ttest(m~time, varanax, var.equal=TRUE)
APA_Ttest(m~time, varanax, var.equal=FALSE)
#broom::tidy(t.test(m~time, varanax, var.equal=TRUE))
#broom::tidy(t.test(m~time, varanax, var.equal=FALSE))

 varanax$m[1] <- NA
APA_Ttest(m ~ time, varanax, paired = TRUE, random=~nr, include.n=TRUE) 



n <- 2 * 20
e <- rnorm(n)
dat <- stp25aggregate::Label(
  data.frame(
    a = rnorm(n) + e / 2,
    b = rnorm(n) + e,
    c = rnorm(n),
    d = rnorm(n) + e * 10,
    g = gl(2, 20, labels = c("Control", "Treat"))
  ),
  a = "Alpha",
  b = "Beta",
  c = "Gamma"
)


APA_Correlation( ~ a + b + c, dat)
APA_Correlation(a ~ c, dat)
APA_Correlation(a + b + c ~ d, dat)
APA_Correlation(a + b ~ c +  d, dat)
APA_Correlation(a + b + c ~ d, dat, groups = ~ g)
APA_Correlation( ~ a + b + c, dat)
APA_Correlation( ~ a + b + c, dat, include.p = TRUE)
APA_Correlation( ~ a + b + c, dat, include.p = TRUE, include.stars = FALSE)

 # library(arm)
 # windows(7,7)
 # corrplot(data[Cs(a,b,c,d)], abs=TRUE, n.col.legend=7)

 # install.packages("PerformanceAnalytics")

 #library("PerformanceAnalytics")
 #?chart.Correlation#(decathlon2.active[, 1:6], histogram=TRUE, pch=19)
 #data(managers)
 #chart.Correlation(managers[,1:8], histogram=TRUE, pch="+")


fit1<-lm(score ~ grade + treatment, schools)
fit2<-lm(score ~ grade + treatment + stdTest, schools)
APA_R2(fit1, fit2)


 DF <- GetData(
"
GoldStandart Schnell.Test Anzahl
positiv positiv 124
positiv negativ 9
negativ positiv 20
negativ negativ 305 ",
Tabel_Expand = TRUE,
id.vars = 1:2,
output = FALSE
)



DF <- transform(
  DF,
  GoldStandart = factor(GoldStandart, rev(levels(DF$GoldStandart))),
  Schnell.Test = factor(Schnell.Test, rev(levels(DF$Schnell.Test)))
)

DF<- Label(DF, GoldStandart="Krank Covid-19", Schnell.Test= "Schnell Test GTV8")
N<- nrow(DF)


xtb <- xtabs( ~ Schnell.Test + GoldStandart  , DF)


APA_Xtabs(xtb)

APA_Xtabs( ~ Schnell.Test  + GoldStandart,
           DF,
           caption = "2x2 Tabelle zur Destimmung der Kennwerte",
           include.percent = FALSE,
           include.total=TRUE)

stp4/stp25stat documentation built on Sept. 17, 2021, 2:03 p.m.