[go: up one dir, main page]

0% found this document useful (0 votes)
47 views12 pages

Aggregation Indices in R

This document provides instructions for downloading and installing R software and relevant packages, importing SPSS data into R, and using R to calculate aggregation indices for team-level analysis. The steps include installing R from the CRAN website, installing packages like foreign, Rcmdr, and multilevel, setting a working directory in R, importing example SPSS data and naming the dataset, estimating Average Deviation Index (ADI) values to assess within-team agreement, running ANOVA to examine between-team differences, and calculating intraclass correlation coefficients ICC(1) and ICC(2). The example analysis shows adequate within-team agreement based on ADI values below 0.83, significant between-team discrimination based on the ANOVA, and
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views12 pages

Aggregation Indices in R

This document provides instructions for downloading and installing R software and relevant packages, importing SPSS data into R, and using R to calculate aggregation indices for team-level analysis. The steps include installing R from the CRAN website, installing packages like foreign, Rcmdr, and multilevel, setting a working directory in R, importing example SPSS data and naming the dataset, estimating Average Deviation Index (ADI) values to assess within-team agreement, running ANOVA to examine between-team differences, and calculating intraclass correlation coefficients ICC(1) and ICC(2). The example analysis shows adequate within-team agreement based on ADI values below 0.83, significant between-team discrimination based on the ANOVA, and
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Ines.Tomas@uv.

es

Aggregation Indices in R

1. Downloading and installing R


Visit the project website http://www.R-project.org/

Click on the link labelled CRAN.

There are various copies (mirrors) of the CRAN across the globe. This link will navigate you to
a page of links to the various “mirror” sites. Scroll down this list to find a mirror near to you.
For example, the mirror closest to me will be one of the links in Spain.

Then, select the platform you use (Linux, MacOs or Windows). I have selected Windows.

Click on the link “install R for the first time”


Ines.Tomas@uv.es

Click on the Download link and follow the install procedure.

Once the program has been installed, you will find the corresponding icon at the Desktop.

Click on the icon of the program and you will open the R Console.
Ines.Tomas@uv.es

2. Installing the needed packages


Copy and paste the following instructions in the R Console:

#install foreign package to import SPSS data


install.packages("foreign")

#install Commander package


install.packages("Rcmdr")

#install package for multilevel analysis


install.packages("multilevel")
Ines.Tomas@uv.es

As previously indicated, there are various copies (mirrors) of the CRAN across the globe.
Again, you will have access to a window of links to the various “mirror” sites. Scroll down this
list to find a mirror near to you. For example, the mirror closest to me will be the one in Madrid
(Spain).

THE INSTALATION PROCEDURE SHOULD BE CARRIED OUT JUST THE FIRST TIME.

ONCE YOU HAVE THE PROGRAMME AND THE PACKAGES INSTALLED IN YOUR
COMPUTER, YOU JUST WILL NEED TO GO DIRECTLY TO “HOW TO OBTAIN
AGGREGATION INDICES IN R” SECTION.

If during the following process you get a message telling to install any other packages that are
needed, just select the option to install the packages from the CRAN:
Ines.Tomas@uv.es

How to obtain Aggregation Indices in R

1. Getting ready: calling back the needed packages

Click on the icon of the program to open the R Console.

Copy and paste the following instructions in the R Console. Those instructions are for calling
back the packages that we are going to be needed to run the analyses (they were previously
installed; now they are called back to be used):

#call package to import SPSS data


library(foreign)

#open Commander package


library(Rcmdr)

#call package for multilevel analysis


library(multilevel)
Remember that if during the process you get a message telling to install any other packages
that are needed, you just have to select the option to install the packages from the CRAN.

You will get a new window: The R Commander window.


Ines.Tomas@uv.es

2. Setting a working directory


The idea is to set the place where the SPSS dataset is located, and the place where the resulting
files will be saved.

We can copy and paste the direction of the directory from the corresponding window. The only
problem is that the “\” lines must be changed for “/”.

When I copy and paste, I got the following (text in green):

setwd("C:\Users\usuario\Google Drive\Doctorado POT\Apuntes Pruebas


Estadísticas\R\Aggregation indices in R") [R will give an error message unless we change the /]

Then I have to change it as follow:

setwd("C:/Users/usuario/Google Drive/Doctorado POT/Apuntes Pruebas


Estadísticas/R/Aggregation indices in R") [OK]

Copy and paste this in the R Commander and Execute:


Ines.Tomas@uv.es

3. Reading data from SPSS


In the R Commander window:

And give a name to the dataset (I have called it “Example”):

Then select the SPSS file with the data to be opened:


Ines.Tomas@uv.es

We can Visualize the dataset to check that the data have been properly imported:

In this example, we are going to obtain aggregation indices for the Support scale. Then, in the
dataset we have:

 The items of the Support scale (ap1, ap2, ap3).


 The mean value in the Support scale for each subject (aptot)
Ines.Tomas@uv.es

4. Estimating the ADI values


Prior to aggregation, we should assess within-team agreement. We can do that by means of the
Average Deviation Index (ADI) proposed by Burke, Finkelstein and Dusig (1999).

Those are the instructions to estimate the ADI for the Support scale in my example (you will
have noticed, that the lines starting with “#” are just notes that we introduce to keep
information that can be useful for us):

#Estimating ADI
AD.SUPPORT.MEAN <- ad.m(Example[,6:8],Example$unidad);

#Obtaining the ADI for each single team


AD.SUPPORT.MEAN

#Obtaining the ADI mean value and the standard deviation


summary(AD.SUPPORT.MEAN)
sqrt(var(AD.SUPPORT.MEAN))

You have to modify the instructions to adapt them to your dataset, and names of your variables.

As we can check in the dataset, the items of the Support scale are placed in columns 6 to 8.
Ines.Tomas@uv.es

When copying and pasting the instructions in the R Commander window, and executing them:

The average ADI value was .60 (SD = .32).

To interpret the ADI values, Burke and Dunlap (2002) recommend using the criterion of AD <
c/6, where c is the number of response alternatives. For a Likert-type 5-point scale, as the one
used in the Support scale, c/6 (5/6) is equal to 0.83. Consequently, we could conclude that there
is within-team agreement if the ADI value is equal to or less than 0.83. Thus, we can conclude
that the average level of within-team agreement is sufficient to aggregate individual scores to
the team level.
Ines.Tomas@uv.es

5. Running the ANOVA


A one-way analysis of variance (ANOVA) allows us to ascertain whether there is statistically
significant between-team discrimination in the study variables (e.g., support) among teams.

Those are the instructions to run an ANOVA for the Support mean value in my example:

#run an ANOVA with unidad as IV and aptot as DV


AnovaSupport <- aov(aptot~as.factor(unidad), data=Example)

#visualizy the results of the ANOVA


summary(AnovaSupport)
You have to modify the instructions to adapt them to your dataset, and names of your variables.

When copying and pasting the instructions in the R Commander window, and executing them:

The F value was statistically significant (F (196, 442) = 2.25, p < .01), indicating that there was
adequate between-team discrimination of team support.
Ines.Tomas@uv.es

6. Estimating the ICC values


We can also estimate the relative consistency of responses among team members and the
reliability of the team mean by computing the intraclass correlation coefficients ICC[1] and
ICC[2], respectively (Bliese, 2000).

Those are the instructions to estimate the ICC values in my example:

#estimate ICC(1)
ICC1(AnovaSupport)
#estimate ICC(2)
ICC2(AnovaSupport)

You have to modify the instructions to adapt them to your variable names. See that the name
that we use is the same that we created for calling the Anova in the previous section.

When copying and pasting the instructions in the R Commander window, and executing them:

The values for ICC[1] and ICC[2] are .28 and .56, respectively, indicating that the level of
consistency of responses among team members and the reliability of the teams’ means on this
scale are adequate

You might also like