ateliers méthodologiques département de biostatistique et unité epitraumac spss - stata
Post on 18-Jan-2016
47 Views
Preview:
DESCRIPTION
TRANSCRIPT
13 novembre 2007
Ateliers méthodologiques Département de Biostatistique et unité Epitraumac SPSS - STATA
Quelques éléments de comparaison
M. Dramaix
13 novembre 2007
Les fichiers – les fenêtres
SPSS : approche similaire de celle des autres logiciels WINDOWS (EXCEL) Données : éditables directement dans la fenêtre Exportation et importation de nombreux types de
fichiers: EXCEl, DBF, STATA, SAS…
STATA : plus proche d’EPIINFO Pas de sauvegarde possible de l’output à posteriori A l’écran, longueur de l’output lisible limitée Données: visibles avec DATA BROWSER Données: éditables avec DATA EDITOR Exportation – importation plus limité: fichiers ASCII,
SAS XPORT
13 novembre 2007
Les fenêtres de SPSS
13 novembre 2007 Les fenêtres de STATA
13 novembre 2007 SPSS DATA VIEW
13 novembre 2007 STATA DATA BROWSER
13 novembre 2007
Les commandes (I)
Dans SPSS
Plus simple La plupart directement accessibles par les
menus Commandes facilement identifiables Commandes non accessibles: utilisation dans la
programmation, par ex: DO REPEAT
13 novembre 2007
Les commandes (II)
Dans STATA
Plus complexe Mais logique dans l’écriture pour options,
sélection… Pas simple de retrouver toutes les commandes
par les menus
13 novembre 2007
Les commandes (III)
Dans STATA Dans certains cas, plusieurs commandes
nécessaires pour une commande SPSS Plus grande nécessité de connaître la théorie
pour trouver les commandes adéquates
moins de risque d’erreur dans le choix des méthodes
Pas d’abréviations, fautes « orthographe », ne confond pas majuscules et minuscules
13 novembre 2007
Exemple 1: test t - SPSS
T-TEST GROUPS = PPN(0 1) /MISSING = ANALYSIS /VARIABLES = PoidM /CRITERIA = CI(.95) .
13 novembre 2007
Exemple 1: test t - STATA
robvar PoidM, by( PPN ) ttest PoidM, by(PPN)
ttest PoidM, by(PPN) unequal
13 novembre 2007
Exemple 2 – Régression (I)
13 novembre 2007
Exemple 2 – Régression STATA (suite)
13 novembre 2007
Exemple 2 – Régression (2)REGRESSION /DESCRIPTIVES MEAN STDDEV CORR SIG N /MISSING LISTWISE /STATISTICS COEFF OUTS R ANOVA COLLIN TOL /CRITERIA=PIN(.05) POUT(.10) /NOORIGIN /DEPENDENT Pnaiss /METHOD=ENTER POIDMK AGEM Tabac Probur /SCATTERPLOT=(*ZRESID ,*ZPRED ) /RESIDUALS HIST(ZRESID) NORM(ZRESID) .
regress Pnaiss POIDMK AGEM Tabac Probur, betapredict fitpredict sdres, rstandardqnorm sdrestwoway (scatter sdres fit)estat vif
Commande SPSS (paste)
Commandes STATA
13 novembre 2007
Exemple 3 – procédure pas à pas
stepwise, pe(0.05): regress POIENF AGEM ETCIV PERBG BAUDE BMI
xi: stepwise, pe(0.05): regress POIENF AGEM i.ETUM ETCIV PERBG BAUDE BMI i.grparite
REGRESSION /MISSING LISTWISE /STATISTICS COEFF OUTS R ANOVA /CRITERIA=PIN(.05) POUT(.10) /NOORIGIN /DEPENDENT POIENF /METHOD=STEPWISE AGEM ETCIV PERBG BAUDE BMI .
Commande SPSS
Commande STATA
Commande STATA avec décomposition en indicateurs
stepwise, pe(0.05): regress POIENF AGEM ETCIV PERBG BAUDE BMI
Commande STATA
stepwise, pe(0.05): regress POIENF AGEM ETCIV PERBG BAUDE BMI
xi: stepwise, pe(0.05): regress POIENF AGEM i.ETUM ETCIV PERBG BAUDE BMI i.grparite
Commande STATA avec décomposition en indicateurs
xi: stepwise, pe(0.05): regress POIENF AGEM i.ETUM ETCIV PERBG BAUDE BMI i.grparite
Commande STATA avec décomposition en indicateurs
xi: stepwise, pe(0.05): regress POIENF AGEM i.ETUM ETCIV PERBG BAUDE BMI i.grparite
13 novembre 2007
Les méthodes disponibles
Plus étendues dans STATA Plus de méthodes appliquées en épidémiologie
Ex: analyse des tables, taille échantillon…
Sorties différentes avec les deux logiciels: plus ou moins de statistiques avec l’un ou l’autre Ex: mesures association dans les tables, ANOVA,
procédures pas à pas…plus détaillé dans SPSS Ex: test d’égalité des variances, mesures
épidémiologiques dans les tables, courbes ROC…plus détaillé dans STATA
13 novembre 2007
Méthodes
13 novembre 2007
Sortie test t - SPSS
Independent Samples Test
1.129 .289 2.354 187 .020 11.164 4.743 1.807 20.522
2.516 132.460 .013 11.164 4.438 2.386 19.943
Equal variancesassumed
Equal variancesnot assumed
Poids mèreavant (pounds)
F Sig.
Levene's Test forEquality of Variances
t df Sig. (2-tailed)Mean
DifferenceStd. ErrorDifference Lower Upper
95% ConfidenceInterval of the
Difference
t-test for Equality of Means
Group Statistics
130 133.30 31.724 2.782
59 122.14 26.559 3.458
PPN>= 2500g
< 2500g
Poids mèreavant (pounds)
N Mean Std. DeviationStd. Error
Mean
13 novembre 2007
Sortie test t – STATA (I)
. robvar PoidM, by( PPN ) | Summary of Poids mère avant | (pounds) PPN | Mean Std. Dev. Freq.------------+------------------------------------ >= 2500g | 133.3 31.724016 130 < 2500g | 122.13559 26.559275 59------------+------------------------------------ Total | 129.81481 30.57938 189W0 = 1.12854604 df(1, 187) Pr > F = 0.28945567W50 = 0.50995689 df(1, 187) Pr > F = 0.47604792W10 = 0.74660652 df(1, 187) Pr > F = 0.38865972
13 novembre 2007
Sortie test t – STATA (II)
. ttest PoidM, by(PPN)Two-sample t test with equal variances------------------------------------------------------------------------------ Group | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval]---------+-------------------------------------------------------------------->= 2500g | 130 133.3 2.78238 31.72402 127.795 138.805 < 2500g | 59 122.1356 3.457723 26.55928 115.2142 129.057---------+--------------------------------------------------------------------combined | 189 129.8148 2.224323 30.57938 125.427 134.2027---------+-------------------------------------------------------------------- diff | 11.16441 4.743297 1.807157 20.52166------------------------------------------------------------------------------ diff = mean(>= 2500g) - mean(< 2500g) t = 2.3537Ho: diff = 0 degrees of freedom = 187 Ha: diff < 0 Ha: diff != 0 Ha: diff > 0 Pr(T < t) = 0.9902 Pr(|T| > |t|) = 0.0196 Pr(T > t) = 0.0098
13 novembre 2007
Sorties Tables - SPSS Chi-Square Tests
4.924b 1 .026
4.236 1 .040
4.867 1 .027
.036 .020
4.898 1 .027
189
Pearson Chi-Square
Continuity Correctiona
Likelihood Ratio
Fisher's Exact Test
Linear-by-LinearAssociation
N of Valid Cases
Value dfAsymp. Sig.
(2-sided)Exact Sig.(2-sided)
Exact Sig.(1-sided)
Computed only for a 2x2 tablea.
0 cells (.0%) have expected count less than 5. The minimum expected count is 23.10.
b.
Symmetric Measures
.161 .026
.161 .026
189
Phi
Cramer's V
Nominal byNominal
N of Valid Cases
Value Approx. Sig.
Not assuming the null hypothesis.a.
Using the asymptotic standard error assuming the nullhypothesis.
b.
Risk Estimate
2.022 1.081 3.783
1.258 1.013 1.561
.622 .409 .945
189
Odds Ratio forTabagisme durantgrossesse (Non / Oui)
For cohort PPN = >=2500g
For cohort PPN = < 2500g
N of Valid Cases
Value Lower Upper
95% ConfidenceInterval
13 novembre 2007
Sorties Tables – STATA (I)
. tabulate Tabac PPN, chi2 column exact expected lrchi2 V+--------------------+| Key ||--------------------|| frequency || expected frequency || column percentage |+--------------------+
Tabagisme | durant | PPN
grossesse | >= 2500g < 2500g | Total-----------+----------------------+---------- Non | 86 29 | 115 | 79.1 35.9 | 115.0 | 66.15 49.15 | 60.85 -----------+----------------------+---------- Oui | 44 30 | 74 | 50.9 23.1 | 74.0 | 33.85 50.85 | 39.15 -----------+----------------------+---------- Total | 130 59 | 189 | 130.0 59.0 | 189.0 | 100.00 100.00 | 100.00
Pearson chi2(1) = 4.9237 Pr = 0.026 likelihood-ratio chi2(1) = 4.8674 Pr = 0.027
Cramér's V = 0.1614 Fisher's exact = 0.036 1-sided Fisher's exact = 0.020
13 novembre 2007
. cc PPN Tabac Proportion | Exposed Unexposed | Total Exposed-----------------+------------------------+------------------------ Cases | 30 29 | 59 0.5085 Controls | 44 86 | 130 0.3385-----------------+------------------------+------------------------ Total | 74 115 | 189 0.3915 | | | Point estimate | [95% Conf. Interval] |------------------------+------------------------ Odds ratio | 2.021944 | 1.029092 3.965864 (exact) Attr. frac. ex. | .5054264 | .0282695 .7478481 (exact) Attr. frac. pop | .2569965 | +------------------------------------------------- chi2(1) = 4.92 Pr>chi2 = 0.0265
Sorties Tables – STATA (II)Tables pour “épidémiologistes”
13 novembre 2007
Sorties Analyse Stratifiée – SPSS (I)Tabagisme durant grossesse * PPN * Ethnie Crosstabulation
40 4 44
54.8% 17.4% 45.8%
33 19 52
45.2% 82.6% 54.2%
73 23 96
100.0% 100.0% 100.0%
11 5 16
73.3% 45.5% 61.5%
4 6 10
26.7% 54.5% 38.5%
15 11 26
100.0% 100.0% 100.0%
35 20 55
83.3% 80.0% 82.1%
7 5 12
16.7% 20.0% 17.9%
42 25 67
100.0% 100.0% 100.0%
Count
% within PPN
Count
% within PPN
Count
% within PPN
Count
% within PPN
Count
% within PPN
Count
% within PPN
Count
% within PPN
Count
% within PPN
Count
% within PPN
Non
Oui
Tabagisme durantgrossesse
Total
Non
Oui
Tabagisme durantgrossesse
Total
Non
Oui
Tabagisme durantgrossesse
Total
EthnieBlanc
Noir
Autres
>= 2500g < 2500g
PPN
TotalChi-Square Tests
9.856b 1 .002
8.407 1 .004
10.636 1 .001
.002 .001
9.753 1 .002
96
2.084c 1 .149
1.073 1 .300
2.091 1 .148
.228 .150
2.004 1 .157
26
.118d 1 .731
.000 1 .988
.117 1 .732
.751 .487
.117 1 .733
67
Pearson Chi-Square
Continuity Correctiona
Likelihood Ratio
Fisher's Exact Test
Linear-by-LinearAssociation
N of Valid Cases
Pearson Chi-Square
Continuity Correctiona
Likelihood Ratio
Fisher's Exact Test
Linear-by-LinearAssociation
N of Valid Cases
Pearson Chi-Square
Continuity Correctiona
Likelihood Ratio
Fisher's Exact Test
Linear-by-LinearAssociation
N of Valid Cases
EthnieBlanc
Noir
Autres
Value dfAsymp. Sig.
(2-sided)Exact Sig.(2-sided)
Exact Sig.(1-sided)
Computed only for a 2x2 tablea.
0 cells (.0%) have expected count less than 5. The minimum expected count is 10.54.b.
1 cells (25.0%) have expected count less than 5. The minimum expected count is 4.23.c.
1 cells (25.0%) have expected count less than 5. The minimum expected count is 4.48.d.
Risk Estimate
5.758 1.782 18.599
1.433 1.142 1.797
.249 .091 .677
96
3.300 .635 17.160
1.719 .751 3.933
.521 .215 1.263
26
1.250 .350 4.462
1.091 .650 1.832
.873 .410 1.857
67
Odds Ratio forTabagisme durantgrossesse (Non / Oui)
For cohort PPN = >=2500g
For cohort PPN = < 2500g
N of Valid Cases
Odds Ratio forTabagisme durantgrossesse (Non / Oui)
For cohort PPN = >=2500g
For cohort PPN = < 2500g
N of Valid Cases
Odds Ratio forTabagisme durantgrossesse (Non / Oui)
For cohort PPN = >=2500g
For cohort PPN = < 2500g
N of Valid Cases
EthnieBlanc
Noir
Autres
Value Lower Upper
95% ConfidenceInterval
13 novembre 2007
Sorties Analyse Stratifiée – SPSS (II)
Tests of Homogeneity of the Odds Ratio
3.126 2 .210
3.125 2 .210
Breslow-Day
Tarone's
Chi-Squared dfAsymp. Sig.
(2-sided)
Tests of Conditional Independence
9.576 1 .002
8.378 1 .004
Cochran's
Mantel-Haenszel
Chi-Squared dfAsymp. Sig.
(2-sided)
Under the conditional independence assumption, Cochran'sstatistic is asymptotically distributed as a 1 df chi-squareddistribution, only if the number of strata is fixed, while theMantel-Haenszel statistic is always asymptotically distributedas a 1 df chi-squared distribution. Note that the continuitycorrection is removed from the Mantel-Haenszel statistic whenthe sum of the differences between the observed and theexpected is 0.
Mantel-Haenszel Common Odds Ratio Estimate
3.086
1.127
.371
.002
1.491
6.390
.399
1.855
Estimate
ln(Estimate)
Std. Error of ln(Estimate)
Asymp. Sig. (2-sided)
Lower Bound
Upper Bound
Common OddsRatio
Lower Bound
Upper Bound
ln(CommonOdds Ratio)
Asymp. 95% ConfidenceInterval
The Mantel-Haenszel common odds ratio estimate is asymptotically normallydistributed under the common odds ratio of 1.000 assumption. So is the natural log ofthe estimate.
13 novembre 2007
Sorties Analyses Stratifiée - STATA
. cc PPN Tabac, by(Ethnie) pool Ethnie | OR [95% Conf. Interval] M-H Weight-----------------+------------------------------------------------- Blanc | 5.757576 1.657574 25.1388 1.375 (exact) Noir | 3.3 .4865385 23.45437 .7692308 (exact) Autres | 1.25 .273495 5.278229 2.089552 (exact)-----------------+------------------------------------------------- Crude | 2.021944 1.029092 3.965864 (exact) Pooled (direct) | 2.945162 1.371751 6.323289 M-H combined | 3.086381 1.49074 6.389949 -------------------------------------------------------------------Test of homogeneity (direct) chi2(2) = 3.02 Pr>chi2 = 0.2213Test of homogeneity (M-H) chi2(2) = 3.03 Pr>chi2 = 0.2197 Test that combined OR = 1: Mantel-Haenszel chi2(1) = 9.41 Pr>chi2 = 0.0022
13 novembre 2007
Autres exemples
ANOVA
Logistique stepwise
…
13 novembre 2007
Graphiques
Performants avec les deux logiciels: édition, exportation
Plus de possibilités avec STATA
Exemples
13 novembre 2007
GraphiquesSPSS
13 novembre 2007
Conclusion
Recherche STATA +
Enseignement SPSS + STATA exige d’aller plus en profondeur dans
la théorie éventuellement plus de détails mathématiques nécessaires
top related