Garantie de satisfaction à 100% Disponible immédiatement après paiement En ligne et en PDF Tu n'es attaché à rien
logo-home
Summary Oplossing van take-home asignment advanced data analysis €6,49   Ajouter au panier

Resume

Summary Oplossing van take-home asignment advanced data analysis

 22 vues  0 fois vendu

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

Aperçu 3 sur 28  pages

  • 6 juillet 2023
  • 28
  • 2022/2023
  • Resume
Tous les documents sur ce sujet (19)
avatar-seller
lauraheyndrickx
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

Les avantages d'acheter des résumés chez Stuvia:

Qualité garantie par les avis des clients

Qualité garantie par les avis des clients

Les clients de Stuvia ont évalués plus de 700 000 résumés. C'est comme ça que vous savez que vous achetez les meilleurs documents.

L’achat facile et rapide

L’achat facile et rapide

Vous pouvez payer rapidement avec iDeal, carte de crédit ou Stuvia-crédit pour les résumés. Il n'y a pas d'adhésion nécessaire.

Focus sur l’essentiel

Focus sur l’essentiel

Vos camarades écrivent eux-mêmes les notes d’étude, c’est pourquoi les documents sont toujours fiables et à jour. Cela garantit que vous arrivez rapidement au coeur du matériel.

Foire aux questions

Qu'est-ce que j'obtiens en achetant ce document ?

Vous obtenez un PDF, disponible immédiatement après votre achat. Le document acheté est accessible à tout moment, n'importe où et indéfiniment via votre profil.

Garantie de remboursement : comment ça marche ?

Notre garantie de satisfaction garantit que vous trouverez toujours un document d'étude qui vous convient. Vous remplissez un formulaire et notre équipe du service client s'occupe du reste.

Auprès de qui est-ce que j'achète ce résumé ?

Stuvia est une place de marché. Alors, vous n'achetez donc pas ce document chez nous, mais auprès du vendeur lauraheyndrickx. Stuvia facilite les paiements au vendeur.

Est-ce que j'aurai un abonnement?

Non, vous n'achetez ce résumé que pour €6,49. Vous n'êtes lié à rien après votre achat.

Peut-on faire confiance à Stuvia ?

4.6 étoiles sur Google & Trustpilot (+1000 avis)

77254 résumés ont été vendus ces 30 derniers jours

Fondée en 2010, la référence pour acheter des résumés depuis déjà 14 ans

Commencez à vendre!
€6,49
  • (0)
  Ajouter