2 Chi-square test Ergebnisse bei gleichem Datensatz

Allgemeine Statistik mit R, die Test-Methode ist noch nicht bekannt, ich habe noch keinen Plan!

Moderatoren: EDi, jogo

Gesperrt
adambaum
Beiträge: 3
Registriert: Do Okt 12, 2023 1:10 pm

2 Chi-square test Ergebnisse bei gleichem Datensatz

Beitrag von adambaum »

Hallo liebe Community,

ich soll einen chi-square test mit folgenden Daten aus einem Korpus durchführen, bekomme allerdings 2 unterschiedliche Ergebnisse:

male female
possibly 8 3 (male 8 occurences, female 3 occurences of "possibly" etc.)
likely 11 2
probably 16 1
maybe 10 13
sometimes 13 10
seems 15 8
seem 13 10
often 24 14
might 34 18
perhaps 51 27
think 460 205

Es soll festgestellt werden, ob ein signifikanter Unterschied in der Verwendung von "hedging words" (possibly, likely etc.) zwischen Männern und Frauen besteht.

Skript, welches uns zur Verfügung gestellt wurde:

Code: Alles auswählen

#Importing and exploring a data table
#replace backslash "\" with two backslashes "\\" in Windows
data <- read.table(choose.files())
#to see the loaded table excecute the following line
#or click on the right on the table symbol in the "Environment" tab
#where a new tab will open
data

#delete "total" column
#use the subset function
data <- subset(data, select=-c(total))

#swap table
t(data)

#inspect structure of the table
#gives insights into the observations (= rows) and variables (= columns)
str(data)

#more statistics on the data
#interesting for integer fields
#gives insights on basic statistics such as mean, median, min and max and inter quartile ranges
#mean = average over all numbers, e.g. 8 + 7 + 3 + 9 + 11 + 4 = 42 ?????? 6 = Mean of 7.0
#median = 50% = middle number in list, e.g. 2 5 7 8 11 "14" 18 21 22 25 29
#min = lowest number, e.g. "2" 5 7 8 11 14 18 21 22 25 29
#max = highest number, e.g. 2 5 7 8 11 14 18 21 22 25 "29"
#1st Quartile = 25%
#3rd Quartile = 75%
summary(data)

#In case more information is needed you can add a column
data$corpus <- "dascitex"
data
#or delete a column
data <- subset(data, select=-c(corpus))
data

#chisquare
chisq.test(data)
ERGEBNIS:

Code: Alles auswählen

#chisquare
chisq.test(data)

Pearson's Chi-squared test

data: data
X-squared = 17.48, df = 10, p-value = 0.06439

Warnmeldung:
In chisq.test(data) : Chi-Quadrat-Approximation kann inkorrekt sein
_________

Bei diesem command wird ein anderes Ergebnis ausgeworfen:

Code: Alles auswählen

chisq.test(data$male, data$female)
ERGEBNIS:

Code: Alles auswählen

chisq.test(data$male, data$female)

Pearson's Chi-squared test

data: data$male and data$female
X-squared = 99, df = 81, p-value = 0.08492

Warnmeldung:
In chisq.test(data$male, data$female) :
Chi-Quadrat-Approximation kann inkorrekt sein
Weiß jemand, warum 2 verschiedene p-values ausgegeben werden und wo der Fehler im Skript liegt?
Danke im Voraus!
bigben
Beiträge: 2781
Registriert: Mi Okt 12, 2016 9:09 am

Re: 2 Chi-square test Ergebnisse bei gleichem Datensatz

Beitrag von bigben »

Das ähnelt dieser Anfrage sehr: viewtopic.php?t=3830
Ich schlage vor, dass wir das nur in einem Thread diskutieren und zwar in dem oben genannten.
---
Programmiere stets so, dass die Maxime Deines Programmierstils Grundlage allgemeiner Gesetzgebung sein könnte
Gesperrt