Docsity

LOGIT formule utilizzate ed esempi di report, Esercizi di Statistica

Toggle sidebar
bg1
REPORT LOGIT + FORMULE
This dataset contains information about 248 women to study the infertility in each case, considering the
following variables:
Education: it is a categorical variable which indicates three class of education for each woman:
- 0 = 0-5 years -1 = 6-11 years -2 = 12+ years
Age: it is a numerical variable which indicates the age of each woman (from 21 to 44);
Parity: it is a numerical variable which refers to the number of children of each woman;
Induced: it is a categorical variable which indicates the number of induced abortion for each
woman and it is divided into three class.
- 0 = 0 -1 = 1 -2 = 2 or more
Case: it is a binary variable which indicates if there is infertility (1) or not (0);
Spontaneous: it is a categorical variable which indicates the number of spontaneous abortion for
each woman and it is divided into three class:
- 0 = 0 -1 = 1 -2 = 2 or more
For the sake of clarity it is useful to notice that the all three categorical variables are specified in the model
with the factor() function that allows to have not three class but only two.
Before deepening the study, it is interesting to analyse the variable with using the contingency table that
allows a better interpretation of them.
The two variables does not present a correlation: in fact the
probability to have infertility is 33,47% and there is not a visible
correlation with each class of years.
Also for the age, there is
not a direct correlation
between data.
Comparing these two
tables, it is possible to affirm
that the probability to have
an infertility is higher when
there are spontaneous
abortion instead induced (considering the highest case, in the first example the probability is 50% in the
second one is 200%).
pf3
pf4

Anteprima parziale del testo

Scarica LOGIT formule utilizzate ed esempi di report e più Esercizi in PDF di Statistica solo su Docsity!

REPORT LOGIT + FORMULE

This dataset contains information about 248 women to study the infertility in each case, considering the following variables:  Education: it is a categorical variable which indicates three class of education for each woman:

  • 0 = 0-5 years - 1 = 6-11 years - 2 = 12+ years  Age: it is a numerical variable which indicates the age of each woman (from 21 to 44);  Parity: it is a numerical variable which refers to the number of children of each woman;  Induced: it is a categorical variable which indicates the number of induced abortion for each woman and it is divided into three class.
  • 0 = 0 - 1 = 1 - 2 = 2 or more  Case: it is a binary variable which indicates if there is infertility (1) or not (0);  Spontaneous: it is a categorical variable which indicates the number of spontaneous abortion for each woman and it is divided into three class:
  • 0 = 0 - 1 = 1 - 2 = 2 or more For the sake of clarity it is useful to notice that the all three categorical variables are specified in the model with the factor() function that allows to have not three class but only two. Before deepening the study, it is interesting to analyse the variable with using the contingency table that allows a better interpretation of them. The two variables does not present a correlation: in fact the probability to have infertility is 33,47% and there is not a visible correlation with each class of years. Also for the age, there is not a direct correlation between data. Comparing these two tables, it is possible to affirm that the probability to have an infertility is higher when there are spontaneous abortion instead induced (considering the highest case, in the first example the probability is 50% in the second one is 200%).

The aim of the study is to analyse how the variables affect the response: in this case the response is a binary variable so it is necessary to apply the Logit Regression Model whose general formula is: Π= e^(Bo+B1x1+…+BpXpi)/1+e^(B0+B1x1+…+BpXpi) First of all, it is useful to apply the model with considering all variables (without stratum and pooled stratum) and reflect on the cofounding effect; from this model, it is evident: Looking at the p-value, it is possible to affirm what I state below that is the lowest effects for the response of the variables education and age. For interpretation, in a Logit Model we use the exponential function (so the results is the exponential of estimate member): Moving from the first class of education to the second one, probability of having infertility decreases by 0,35. Moving from the first class of education to the third one, probability of having infertility decreases by 0,25. Moving from the years, probability of having infertility increases by 1,04. Moving from the number of children, probability of having infertility decreases by 0,92. Moving from the first class of induced to the second one, probability of having infertility increases by 3,52. Moving from the first class of education to the third one, probability of having infertility increases by 13,36. Moving from the first class of spontaneous to the second one, probability of having infertility increases by 7,62. Moving from the first class of education to the third one, probability of having infertility increases by 60,27. The AIC value (which is an estimator of the relatives information lost by a given model) results equal to 275,78.

FORMULE:

ls() head(d) tail(d) dim(d) attach(d) summary(d) par(mfrow=c(2,2)) hist(working,col=1) hist(parities,col=2) hist(sec.school,col=3) hist(ageGroup,col=4) o<-glm(working~parities+sec.school+ageGroup) IN CASO DI VAR. CAT TRASFORMARE IN FACTOR summary(o) table(working,parities) table(working,sec.school) table(working,ageGroup) 115/(107+115) 34/(34+58) 55/(55+70) ODD-RATIO= si calcola per l’interpretazione dei coeffic nella logit