You are on page 1of 7

ANCOVA analysis in Excel tutorial

Dataset
 Download data (1)ᄃ

This tutorial will help you set up and interpret an Analysis of Covariance
(ANCOVA)ᄃ in Excel using the XLSTAT software.
Not sure this is the modeling feature you are looking for? Check out this
guide ᄃ.

Dataset for running an ANCOVA


The data have been obtained in Lewis T. and Taylor L.R. (1967).
Introduction to Experimental Ecology, New York: Academic Press, Inc.
They concern 237 children, described by their Gender, Age in months,
Height in inches (1 inch = 2.54 cm), and Weight in pounds (1 pound =
0.45 kg).

Goal of this Analysis of Covariance (ANCOVA)


Using the Analysis of Covariance (ANCOVA), we want to find out how
children weight varies with their gender (a qualitative variable that
takes value form), their height and their age, and to verify if a linear
model makes sense. The ANCOVA method belongs to a larger family of
models called GLM (Generalized Linear Models) as do the ANOVA ᄃ.

The specificity of ANCOVA is that it mixes qualitative and quantitative


explanatory variables. In two other tutorials on linear regression, this
dataset is also used, with the Height and then the Height and the Age as
explanatory variables.

Setting up an ANCOVA
After opening XLSTAT, select the XLSTAT / Modeling data / ANCOVA
function.

Once you've clicked on the button, the ANCOVA dialog box appears. Select
the data on the Excel sheet. The Dependent variable (or variable to
model) is here the Weight.

The quantitative explanatory variables are the height and the age. The
qualitative variable is the gender. As we selected the column title for
the variables, we leave the option Variable labels activated. The
other options have been left at their default value.

The computations begin once you have clicked on OK. The results will
then be displayed.

Interpreting the results of an ANCOVA


The first table displays the goodness of fit coefficients of the model.
The R’² (coefficient of determination) indicates the % of the
variability of the dependent variable which is explained by the
explanatory variables. The closer to 1 the R’² is, the better the fit.

In this particular case, 63 % of the variability of the Weight is


explained by the Height, the Age, and the Gender. The remainder of the
variability is due to some effects (other explanatory variables) that
have not been or that could not be measured during this experiment. We
can guess that some genetic and nutritive effects are involved, but it
might be that simply by transforming the available variables we could
obtain some better results.

It is important to examine the results of the analysis of variance table


(see below). The results enable us to determine whether or not the
explanatory variables bring significant information (null hypothesis H0)
to the model. In other words, it's a way of asking yourself whether it
is valid to use the mean to describe the whole population, or whether
the information brought by the explanatory variables is of value or not.

The Fisher's F test is used. Given the fact that the probability
corresponding to the F value is lower than 0.0001, it means that we
would be taking a lower than 0.01% risk in assuming that the null
hypothesis (no effect of the two explanatory variables) is wrong.
Therefore, we can conclude with confidence that the three variables do
bring a significant amount of information.

We also want to find out if the three variables provide the same amount
of information. To do this, we have to examine the Type I SS and Type
III SS tables (see below). The Type I SS table is constructed by adding
variables in the model one by one, and by evaluating the impact of each
on the model sum of squares (Model SS). In consequence, in Type I SS,
the order in which the variables are selected will influence the
results. The lower the F probability corresponding to a given variable,
the stronger the impact of the variable on the model as it is before the
variable is added to it. We can see here that the Gender bring only a
little information to the model, once the Height and the Age have been
added.

The Type III SS table is computed by removing one variable of the model
at a time to evaluate its impact on the quality of the model. This means
that the order in which the variables are selected will not have any
effect on the values in the Type III SS. The Type III SS is generally
the best method to use to interpret results when an interaction is part
of the model. The lower the F probability corresponding to a given
variable, the stronger the impact of the variable on the model. We can
see that the gender brings the least information to the model.

The following table gives details on the model. This table is helpful
when predictions are needed, or when you need to compare the
coefficients of the model for a given population with the ones obtained
for another population. We can see that the p-value for the Gender
parameter is 0.83, and that the corresponding confidence range includes
0. This confirms the weak impact of the Gender on the model. If we look
at the parameter corresponding to Gender-f, it seems that for a given
age and height, being a girl means a small inccrease of the weight.

The next table shows the residuals. It enables us to take a closer look
at each of the standardized residuals. These residuals, given the
assumptions of the linear regression model, should be normally
distributed, meaning that 95% of the residuals should be in the interval
[-1.96, 1.96]. All values outside this interval are potential outliers,
or might suggest that the normality assumption is wrong. We used
XLSTAT's DataFlagger (see the Tools toolbar) to bring out the residuals
that are not in the [-1.96, 1.96] interval.

We can identify 16 suspicious residuals out of 237, that is to say, 6%


instead of 5%, an analysis that could lead to rejecting the hypothesis
of normality. A more in-depth analysis of the residuals has been
performed in a tutorial on distribution fitting ᄃ.

The chart below shows the predicted values versus the observed values.
Confidence intervals allow to identify potential outliers.
The residuals bar chart (see below) allows us to visualize the
standardized residuals versus the Weight. It indicates that the
residuals grow with the Weight. The histogram of the residuals enables
us to quickly visualize the residuals that are out of the range [-2, 2].

Conclusion for this ANCOVA


As a conclusion, the Height, the Age, and the Gender allow us to explain
63% of the variability of the Weight. A significant amount of
information is not explained by the ANCOVA model we have used. Further
analyses would be necessary.

Analisis ANCOVA dalam tutorial Excel


Himpunan data
 Unduh data (1)ᄃ
Tutorial ini akan membantu Anda mengatur dan menafsirkan Analisis Kovarian
(ANCOVA)ᄃ di Excel menggunakan perangkat lunak XLSTAT.
Tidak yakin ini adalah fitur pemodelan yang Anda cari? Lihatlah panduan
ini ᄃ .

Dataset untuk menjalankan ANCOVA


Data telah diperoleh dalam Lewis T. dan Taylor LR (1967). Pengantar
Ekologi Eksperimental, New York: Academic Press, Inc. Mereka melibatkan
237 anak-anak, dijelaskan berdasarkan Jenis Kelamin mereka, Umur dalam
hitungan bulan, Tinggi dalam inci (1 inci = 2,54 cm), dan Berat dalam
pound (1 pon = 0,45 kg).

Tujuan Analisis Kovarian ini (ANCOVA)


Dengan menggunakan Analisis Kovarian (ANCOVA), kami ingin mengetahui
bagaimana berat badan anak bervariasi dengan jenis kelamin mereka
(variabel kualitatif yang mengambil bentuk nilai), tinggi dan usia
mereka, dan untuk memverifikasi apakah model linear masuk akal. Metode
ANCOVA termasuk dalam kelompok model yang lebih besar yang disebut GLM
(Generalized Linear Models) seperti halnya ANOVA ᄃ .
Kekhasan ANCOVA adalah bahwa ia mencampur variabel penjelas kualitatif
dan kuantitatif. Dalam dua tutorial lain tentang regresi linier, dataset
ini juga digunakan, dengan Tinggi dan kemudian Tinggi dan Usia sebagai
variabel penjelas.

Menyiapkan ANCOVA
Setelah membuka XLSTAT, pilih fungsi XLSTAT / Data Modeling /
ANCOVA .

Setelah Anda mengklik tombol, kotak dialog ANCOVA muncul. Pilih data
pada lembar Excel. The Variabel dependen (atau variabel untuk model)
di sini Berat.
Variabel penjelas kuantitatif adalah tinggi dan usia. Variabel
kualitatif adalah jenis kelamin. Ketika kami memilih judul kolom untuk
variabel, kami membiarkan opsi label Variabel diaktifkan. Opsi lain
telah dibiarkan pada nilai standarnya.

Perhitungan dimulai setelah Anda mengklik OK . Hasilnya kemudian


akan ditampilkan.

Menafsirkan hasil ANCOVA


Tabel pertama menampilkan koefisien goodness of fit model. R'²
(koefisien determinasi) menunjukkan% dari variabilitas variabel dependen
yang dijelaskan oleh variabel penjelas. Semakin dekat ke 1 R'², semakin
baik kecocokannya.

Dalam kasus khusus ini, 63% dari variabilitas Bobot dijelaskan oleh
Tinggi, Umur, dan Jenis Kelamin. Sisa dari variabilitas adalah karena
beberapa efek (variabel penjelas lainnya) yang belum atau yang tidak
dapat diukur selama percobaan ini. Kita dapat menebak bahwa beberapa
efek genetik dan nutrisi terlibat, tetapi mungkin hanya dengan mengubah
variabel yang tersedia kita dapat memperoleh beberapa hasil yang lebih
baik.
Penting untuk memeriksa hasil analisis tabel varians (lihat di bawah).
Hasil memungkinkan kita untuk menentukan apakah variabel penjelas
membawa informasi yang signifikan (hipotesis nol H0) ke model. Dengan
kata lain, ini adalah cara bertanya pada diri sendiri apakah valid
menggunakan rata-rata untuk menggambarkan seluruh populasi, atau apakah
informasi yang dibawa oleh variabel penjelas bernilai atau tidak.

Uji F Fisher digunakan. Mengingat fakta bahwa probabilitas yang


sesuai dengan nilai F lebih rendah dari 0,0001, itu berarti bahwa kita
akan mengambil risiko yang lebih rendah dari 0,01% dalam mengasumsikan
bahwa hipotesis nol (tidak ada pengaruh dari dua variabel penjelas)
salah. Oleh karena itu, kita dapat menyimpulkan dengan keyakinan bahwa
ketiga variabel tersebut membawa sejumlah besar informasi.
Kami juga ingin mengetahui apakah ketiga variabel memberikan jumlah
informasi yang sama. Untuk melakukan ini, kita harus memeriksa tabel
Tipe I SS dan Tipe III SS (lihat di bawah). Tabel SS Tipe I dibangun
dengan menambahkan variabel dalam model satu per satu, dan dengan
mengevaluasi dampak masing-masing pada jumlah model kuadrat (Model SS).
Karena itu, dalam Tipe I SS, urutan variabel dipilih akan mempengaruhi
hasil. Semakin rendah probabilitas F yang sesuai dengan variabel yang
diberikan, semakin kuat dampak variabel terhadap model sebagaimana
sebelum variabel ditambahkan. Kita dapat melihat di sini bahwa Jender
hanya membawa sedikit informasi ke model, begitu Tinggi dan Zaman telah
ditambahkan.
Tabel SS Tipe III dihitung dengan menghapus satu variabel model
sekaligus untuk mengevaluasi dampaknya terhadap kualitas model. Ini
berarti bahwa urutan variabel dipilih tidak akan mempengaruhi nilai
dalam Tipe III SS. Tipe III SS umumnya merupakan metode terbaik untuk
digunakan untuk menginterpretasikan hasil ketika interaksi adalah bagian
dari model. Semakin rendah probabilitas F sesuai dengan variabel yang
diberikan, semakin kuat dampak variabel pada model. Kita dapat melihat
bahwa gender membawa informasi paling sedikit ke model.

Tabel berikut memberikan detail tentang model. Tabel ini sangat


membantu ketika prediksi diperlukan, atau ketika Anda perlu
membandingkan koefisien model untuk populasi tertentu dengan yang
diperoleh untuk populasi lain. Kita dapat melihat bahwa nilai-p untuk
parameter Gender adalah 0,83, dan rentang kepercayaan yang sesuai
mencakup 0. Ini menegaskan dampak lemah Gender pada model. Jika kita
melihat parameter yang berhubungan dengan Gender-f, tampaknya untuk usia
dan tinggi tertentu, menjadi seorang gadis berarti peningkatan kecil
dari berat badan.

Tabel selanjutnya menunjukkan residu. Ini memungkinkan kami untuk


melihat lebih dekat pada masing-masing residu terstandarisasi. Residu
ini, dengan asumsi model regresi linier, harus didistribusikan secara
normal, yang berarti bahwa 95% residu harus dalam interval [-1,96,
1,96]. Semua nilai di luar interval ini adalah outlier potensial, atau
mungkin menunjukkan bahwa asumsi normal salah. Kami menggunakan
DataFlagger XLSTAT (lihat bilah alat Tools) untuk mengeluarkan residu
yang tidak ada dalam interval [-1,96, 1,96].
Kita dapat mengidentifikasi 16 residu yang mencurigakan dari 237, yaitu,
6%, bukannya 5%, sebuah analisis yang dapat mengarah pada penolakan
hipotesis normalitas. Analisis residu yang lebih mendalam telah
dilakukan dalam tutorial tentang distribusi pas ᄃ .
Bagan di bawah ini menunjukkan nilai prediksi versus nilai yang diamati.
Interval kepercayaan memungkinkan untuk mengidentifikasi outlier
potensial.

Bagan batang residual (lihat di bawah) memungkinkan kita untuk


memvisualisasikan residu terstandarisasi versus Bobot. Ini menunjukkan
bahwa residu tumbuh bersama Bobot. Histogram residu memungkinkan kita
untuk dengan cepat memvisualisasikan residu yang berada di luar
jangkauan [-2, 2].

Kesimpulan untuk ANCOVA ini


Sebagai kesimpulan, Tinggi, Umur, dan Jenis Kelamin memungkinkan kita
untuk menjelaskan 63% dari variabilitas Bobot. Sejumlah besar informasi
tidak dijelaskan oleh model ANCOVA yang telah kami gunakan. Diperlukan
analisis lebih lanjut.

You might also like