Geschrieben von Student*innen, die bestanden haben Sofort verfügbar nach Zahlung Online lesen oder als PDF Falsches Dokument? Kostenlos tauschen 4,6 TrustPilot
logo-home
Zusammenfassung

Summary Oplossing van take-home asignment advanced data analysis

Bewertung
-
Verkauft
1
seiten
28
Hochgeladen auf
06-07-2023
geschrieben in
2022/2023

Oplossingen (met R-codes) van de take-home asignment gegeven na practicum 2 in de cursus advanced data analysis

Hochschule
Kurs

Inhaltsvorschau

Take-home exercise : Statistics refresher
The following take-home exercise guides you through the statistical tests you saw in previous
courses. Run these analyses and study the output. Try to answer the questions that were asked.

After completing this assignment (and the second practicum), you should be able to perform
elementary statistical tests in R.

For the test on March 16

-You will get multiple choice and fill-in questions, based upon the take-home exercise. Most
questions on the test will literally come out of this exercise. Some questions will require you to re-run
some of the analyses. The exercises on ANOVA and regression from the second practical are part of
the test.

- The test is open-book. You are allowed to take your solutions with you (or any other
documentation). Blackboard and the internet will be accessible. You can bring your own laptop or
tablet, but the test itself must be done on the desktop PC.

- You do not have to hand in the solutions or the R-code, but I would definitely recommend to take
the Rscript of the exercise with you. You are allowed to bring it on a memorystick and from that
memorystick copy the files onto the local PC. Mind that, if you copy your script from memorystick to
the local PC, you need to adjust the path of the working directory!

p-value higher than 0,05 is not significant
P-value of 0,05 or lower is significant
 if the p-value is smaller than chosen significance level of 0,05 we can reject our H0

,1. Independent sample t-test
The independent samples t-test is used to compare the mean of a continuous variable between two
groups. That is to say, we test the null hypothesis that the mean of the continuous variable is equal in
the two groups. The observations in group 1 are independent from the observations in group 2 – no
individual has been measured twice.

Check out the t.test function using ?t.test. Like the lm() function, the t.test() function can take a
formula of the form y~x as argument:

t.test(y~x)

The help on the formula argument tells you which variable is x and which variable is y in an
independent sample t-test.

Dataset energy, which contains records of energy expenditure in lean and obese women. These data
are supplied via BB for regular read-in via read.table().

The variable stature is a factor, indicating group and the numeric variable expend shows the energy
expenditure in mega-Joules. With the t-test, you can test the null hypothesis that the energy
expenditure is the same in the lean and the obese group:

t.test(expendstature, data=energy)




The tilde operator is used like in regression and ANOVA : the expenditure is the dependent
(outcome) variable, describes (or predicted) by the stature.

The default output shows a significant p-value, indicating that the difference in mean energy
expenditure between the lean and obese women is significant.

To extract the p-value from the results of the t.test, we first store the results of our t.test into the
object we call (for example) : ttestResult (you can give the object any name you want…the name
‘tomatosoup’ also works.)

ttestResult <- t.test(expendstature, data=energy)

With the names function, we check what objects can be extracted from the ttestResult object.

names(ttestResult)
ttestResult$p.value

If the p-value of a t.test is smaller than 0,05, the result is statistically significant

, Questions :

1) extract the boundaries of the 95% confidence interval from the ttestResults object
2) Make a boxplot to check if the results of the t-test are in line with the raw data
3) From your previous statistics course, you remember that there are two types of t-tests: the t-test
for equal variances and the t-test for unequal variances. Look up in the help file which t.test is
performed by default in R: the test for equal variances or the test for unequal variances.
4) To know if the variance in our two groups is the same, SPSS automatically provided you a statistical
test (“Levene’s test”), testing the null hypothesis that the variance was equal in both groups. Look up
a similar test for the equality of variances in R (Use Google…several solutions possible). Test whether
you have equal variances in the current dataset.
5) Based upon the result of the previous test, perform the appropriate t-test (equal variance or not)
to analyse whether the mean energy expenditure of the lean group is different from the obese group



1




3 If var.equal is TRUE then the pooled estimate of the variance is used. By default,
if var.equal is FALSE then the variance is estimated separately for both groups and the
Welch modification to the degrees of freedom is used.
The standard test used in R = FALSE → Welch Two Sample t-test, choosing for TRUE will give
you the Two Sample t-test
4 H0 states that all groups variances are equal
Levene’s test is an inferential statistic used to evaluate the equality of variances for a variable
determined for two or more groups.
Possible similar test = F-test: are variances of two populations (A and B) equal
→ var . test ¿
In this case, the p-value in the F-test is larger than 0,05 → not-significant → no rejection H0 →
the variance between groups is not different

Schule, Studium & Fach

Hochschule
Studium
Kurs

Dokument Information

Hochgeladen auf
6. juli 2023
Anzahl der Seiten
28
geschrieben in
2022/2023
Typ
ZUSAMMENFASSUNG

Themen

6,99 €
Vollständigen Zugriff auf das Dokument erhalten:

Falsches Dokument? Kostenlos tauschen Innerhalb von 14 Tagen nach dem Kauf und vor dem Herunterladen kannst du ein anderes Dokument wählen. Du kannst den Betrag einfach neu ausgeben.
Geschrieben von Student*innen, die bestanden haben
Sofort verfügbar nach Zahlung
Online lesen oder als PDF

Lerne den Verkäufer kennen

Seller avatar
Bewertungen des Ansehens basieren auf der Anzahl der Dokumente, die ein Verkäufer gegen eine Gebühr verkauft hat, und den Bewertungen, die er für diese Dokumente erhalten hat. Es gibt drei Stufen: Bronze, Silber und Gold. Je besser das Ansehen eines Verkäufers ist, desto mehr kannst du dich auf die Qualität der Arbeiten verlassen.
lauraheyndrickx Universiteit Antwerpen
Folgen Sie müssen sich einloggen, um Studenten oder Kursen zu folgen.
Verkauft
42
Mitglied seit
6 Jahren
Anzahl der Follower
23
Dokumente
119
Zuletzt verkauft
3 Jahren vor

4,1

13 rezensionen

5
5
4
6
3
1
2
0
1
1

Kürzlich von dir angesehen.

Warum sich Studierende für Stuvia entscheiden

on Mitstudent*innen erstellt, durch Bewertungen verifiziert

Geschrieben von Student*innen, die bestanden haben und bewertet von anderen, die diese Studiendokumente verwendet haben.

Nicht zufrieden? Wähle ein anderes Dokument

Kein Problem! Du kannst direkt ein anderes Dokument wählen, das besser zu dem passt, was du suchst.

Bezahle wie du möchtest, fange sofort an zu lernen

Kein Abonnement, keine Verpflichtungen. Bezahle wie gewohnt per Kreditkarte oder Sofort und lade dein PDF-Dokument sofort herunter.

Student with book image

“Gekauft, heruntergeladen und bestanden. So einfach kann es sein.”

Alisha Student

Häufig gestellte Fragen