Generalizability Theory


Note: Input values must be separated by tabs. Copy and paste from Excel/Numbers.

Your data needs to have exactly the same header (variable names) in the first row.



                
                

Variance components


                

G-coefficient


                

Phi


                

D study


                


R session info

              

Note: Input values must be separated by tabs. Copy and paste from Excel/Numbers.

Your data needs to have exactly the same header (variable names) in the first row.


p × i Design


                
                

p × r × i Design


                
                
Note

This web application is developed with Shiny.


List of Packages Used
library(shiny)
library(shinyAce)
library(lme4)

Code

Source code for this application is based on "The handbook of Research in Foreign Language Learning and Teaching" (Takeuchi & Mizumoto, 2012) and MacR.

The code for this web application is available at GitHub.

If you want to run this code on your computer (in a local R session), run the code below:
library(shiny)
runGitHub("g-theory","mizumot")


Citation in Publications

Mizumoto, A. (2015). Langtest (Version 1.0) [Web application]. Retrieved from http://langtest.jp


Article

Mizumoto, A., & Plonsky, L. (2015). R as a lingua franca: Advantages of using R for quantitative research in applied linguistics. Applied Linguistics, Advance online publication. doi:10.1093/applin/amv025


Recommended

To learn more about R, I suggest this excellent and free e-book (pdf), A Guide to Doing Statistics in Second Language Research Using R, written by Dr. Jenifer Larson-Hall.

Also, if you are a cool Mac user and want to use R with GUI, MacR is defenitely the way to go!


Author

Atsushi MIZUMOTO, Ph.D.
Professor of Applied Linguistics
Faculty of Foreign Language Studies /
Graduate School of Foreign Language Education and Research,
Kansai University, Osaka, Japan



Code for "Generalizability Theory"
by Atsushi Mizumoto

show with app
library(shiny)
library(shinyAce)
library(lme4)




shinyServer(function(input, output) {

################################################
# To be used later
################################################

    mod <- reactive({
    
        dat <- read.csv(text=input$text, sep="\t")
        
        
        if (input$type == "pi") {
        
        dat$Student <- factor(rownames(dat)) # id番号付与
        col.n <- length(dat)-1
        dat <- reshape(dat, idvar="Student", varying=2:col.n, v.names="Score", direction = "long")
        dat <- dat[,-1]
        colnames(dat) <- c("Student", "Item", "Score")
        dat$Item <- factor(dat$Item)
        
        model <- lmer(Score ~ (1|Student) + (1|Item),dat)
        
        } else { # in case of "pri"

        # 得点以外を因子の型に変更
        dat$Student <- factor(dat$Student)
        dat$Rater <- factor(dat$Rater)
        dat$Item <- factor(dat$Item)
    
        model <- lmer(Score ~ 1 + (1|Rater) + (1|Student) + (1|Item) + (1|Student:Rater) + (1|Student:Item) + (1|Rater:Item), data=dat)
        
        }
        
        list(model = model) # To be used later
        
        
    })





################################################
# Variance components (Sorted)
################################################

   var.est <- reactive({
        
        dat <- read.csv(text=input$text, sep="\t")
        
        
        if (input$type == "pi") {
            
            dat$Student <- factor(rownames(dat)) # id番号付与
            col.n <- length(dat)-1
            dat <- reshape(dat, idvar="Student", varying=2:col.n, v.names="Score", direction = "long")
            dat <- dat[,-1]
            colnames(dat) <- c("Student", "Item", "Score")
            dat$Item <- factor(dat$Item)
            
            model <- lmer(Score ~ (1|Student) + (1|Item),dat)
            
            vcomp <- VarCorr(model)
            vcompLbls <- c("Student","Item")
            
        } else { # in case of "pri"
            
            dat$Student <- factor(dat$Student)
            dat$Rater <- factor(dat$Rater)
            dat$Item <- factor(dat$Item)
        
            counts <- list(length(levels(dat$Rater)),length(levels(dat$Item)))
            names(counts) <- c("Rater","Item")
            model <- lmer(Score ~ (1|Student) + (1|Rater) + (1|Item) + (1|Student:Rater) + (1|Student:Item) + (1|Item:Rater), dat)
            vcomp <- VarCorr(model)
            vcompLbls <- c("Student","Rater","Item","Student:Rater","Student:Item","Item:Rater")
        
        }
        
        varCompTable <- function(vcomp,vcompLbls) {
            compOut <- c()
            lbl <- c()
            for(i in 1:length(vcomp)){
                compOut[i] <- vcomp[[vcompLbls[i]]][,1]
                lbl[i] <- vcompLbls[i]
            }
            compOut[length(vcomp)+1] <- attr(vcomp, "sc")[[1]]^2
            lbl[length(vcomp)+1] <- "Residual"
            
            compTbl <- data.frame(round(compOut,3),round(compOut/sum(compOut),3)*100)
            #rownames(compTbl) <- lbl
            rownames(compTbl) <- gsub(":","*",lbl)
            colnames(compTbl) <- c("VarComp","%")
            
            compTblTemp <- compTbl[1:(nrow(compTbl)-1),]
            compTblTemp <- compTblTemp[order(compTblTemp[,1],decreasing=T),]
            compTblOrderd <- rbind(compTblTemp,compTbl[nrow(compTbl),])
            cat("Variance components\n\n")
            print(compTbl)
            cat("\nVariance components (Sorted)\n\n")
            print(compTblOrderd)
        }
        
        varCompTable(vcomp, vcompLbls)
    
   })





################################################
# G-coefficient
################################################

    g.coef <- reactive({
        
        dat <- read.csv(text=input$text, sep="\t")
        
        
        
        if (input$type == "pi") {
            
            dat$Student <- factor(rownames(dat)) # id番号付与
            col.n <- length(dat)-1
            dat <- reshape(dat, idvar="Student", varying=2:col.n, v.names="Score", direction = "long")
            dat <- dat[,-1]
            colnames(dat) <- c("Student", "Item", "Score")
            dat$Item <- factor(dat$Item)
            
            counts <- length(levels(dat$Item))
            names(counts) <- c("Item")
            
            model <- lmer(Score ~ (1|Student) + (1|Item),dat)
            
            vcomp <- VarCorr(model)
            vcompLbls <- c("Student","Item")
            
        } else { # in case of "pri"
            
            dat$Student <- factor(dat$Student)
            dat$Rater <- factor(dat$Rater)
            dat$Item <- factor(dat$Item)
            
            counts <- list(length(levels(dat$Rater)),length(levels(dat$Item)))
            names(counts) <- c("Rater","Item")
            model <- lmer(Score ~ (1|Student) + (1|Rater) + (1|Item) + (1|Student:Rater) + (1|Student:Item) + (1|Item:Rater), dat)
            vcomp <- VarCorr(model)
            vcompLbls <- c("Student","Rater","Item","Student:Rater","Student:Item","Item:Rater")
            
        }
        
        
        calcGCoefficient <- function(uniVal,vcomp,vcompLbls,ids,counts) {
            denoms <- c()
            denomsVal <- c()
            denoms[1] <- "as.numeric(vcomp[[uniVal]])"
            denomsVal[1] <- as.numeric(vcomp[[uniVal]])
            if (length(ids) > 0) {
                for(i in 1:length(ids)) {
                    denomItem <- gsub(paste(":",uniVal,"|",uniVal,":",sep=""),"",vcompLbls[ids[i]])
                    if (length(grep(":",denomItem)) > 0){
                        items <- strsplit(denomItem,":")
                        countNums <- c()
                        for (j in 1:length(items[[1]])) {
                            countNums[j] <- counts[[items[[1]][j]]]
                        }
                        denoms[i+1] <- paste('(as.numeric(vcomp[[vcompLbls[ids[',i,']]]]) / ',prod(countNums),')',sep="")
                        denomsVal[i+1] <- as.numeric(vcomp[[vcompLbls[ids[i]]]]) / prod(countNums)
                    } else {
                        denoms[i+1] <- paste('(as.numeric(vcomp[[vcompLbls[ids[',i,']]]]) / counts[[gsub(paste(":",uniVal,"|",uniVal,":",sep=""),"",vcompLbls[ids[',i,']])]])',sep="")
                        denomsVal[i+1] <- as.numeric(vcomp[[vcompLbls[ids[i]]]]) / counts[[gsub(paste(":",uniVal,"|",uniVal,":",sep=""),"",vcompLbls[ids[i]])]]
                    }
                }
            }
            
            countNums <- c()
            for (i in 1:length(counts)) {
                countNums[i] <- counts[[i]]
            }
            denoms[length(denoms) + 1] <- '(attr(vcomp, "sc")[[1]]^2 / prod(countNums))'
            denomsVal[length(denomsVal) + 1] <- attr(vcomp, "sc")[[1]]^2 / prod(countNums)
            return(eval(parse(text=paste(denoms[1],"/ (",paste(denoms,collapse=" + "),")"))))
        }

        gcoeff <- calcGCoefficient("Student",vcomp,vcompLbls,grep(":Student\\b|\\bStudent:",vcompLbls),counts)

        cat("G =", substr(sprintf("%.3f", round(gcoeff, 3)), 2, 5))

    })
    
    
    
    

################################################
# Phi
################################################

    phi <- reactive({
    
        dat <- read.csv(text=input$text, sep="\t")
    
    
        if (input$type == "pi") {
        
            dat$Student <- factor(rownames(dat)) # id番号付与
            col.n <- length(dat)-1
            dat <- reshape(dat, idvar="Student", varying=2:col.n, v.names="Score", direction = "long")
            dat <- dat[,-1]
            colnames(dat) <- c("Student", "Item", "Score")
            dat$Item <- factor(dat$Item)
        
            counts <- length(levels(dat$Item))
            names(counts) <- c("Item")
        
            model <- lmer(Score ~ (1|Student) + (1|Item),dat)
        
            vcomp <- VarCorr(model)
            vcompLbls <- c("Student","Item")
        
        } else { # in case of "pri"
        
            dat$Student <- factor(dat$Student)
            dat$Rater <- factor(dat$Rater)
            dat$Item <- factor(dat$Item)
        
            counts <- list(length(levels(dat$Rater)),length(levels(dat$Item)))
            names(counts) <- c("Rater","Item")
            model <- lmer(Score ~ (1|Student) + (1|Rater) + (1|Item) + (1|Student:Rater) + (1|Student:Item) + (1|Item:Rater), dat)
            vcomp <- VarCorr(model)
            vcompLbls <- c("Student","Rater","Item","Student:Rater","Student:Item","Item:Rater")
        
        }



        calcPhiCoefficient <- function(uniVal,vcomp,vcompLbls,counts) {
            denoms <- c()
            denomsVal <- c()
            denoms[1] <- "as.numeric(vcomp[[uniVal]])"
            denomsVal[1] <- as.numeric(vcomp[[uniVal]])
            if (length(vcompLbls) > 2) {
                for(i in 2:length(vcompLbls)) {
                    denomItem <- gsub(paste(":",uniVal,"|",uniVal,":",sep=""),"",vcompLbls[i])
                    if (length(grep(":",denomItem)) > 0){
                        items <- strsplit(denomItem,":")
                        countNums <- c()
                        for (j in 1:length(items[[1]])) {
                            countNums[j] <- counts[[items[[1]][j]]]
                        }
                        denoms[i] <- paste('(as.numeric(vcomp[[vcompLbls[',i,']]]) / ',prod(countNums),')',sep="")
                        denomsVal[i] <- as.numeric(vcomp[[vcompLbls[i]]]) / prod(countNums)
                    } else {
                        denoms[i] <- paste('(as.numeric(vcomp[[vcompLbls[',i,']]]) / counts[[gsub(paste(":",uniVal,"|",uniVal,":",sep=""),"",vcompLbls[',i,'])]])',sep="")
                        denomsVal[i] <- as.numeric(vcomp[[vcompLbls[i]]]) / counts[[gsub(paste(":",uniVal,"|",uniVal,":",sep=""),"",vcompLbls[i])]]
                    }
                }
            } else {
                denoms[2] <- paste('(as.numeric(vcomp[[vcompLbls[2]]]) / ',prod(counts[[1]]),')',sep="")
                denomsVal[2] <- as.numeric(vcomp[[vcompLbls[2]]]) / prod(counts[[1]])
            }
            countNums <- c()
            for (i in 1:length(counts)) {
                countNums[i] <- counts[[i]]
            }
            denoms[length(denoms) + 1] <- '(attr(vcomp, "sc")[[1]]^2 / prod(countNums))'
            denomsVal[length(denomsVal) + 1] <- attr(vcomp, "sc")[[1]]^2 / prod(countNums)
            return(eval(parse(text=paste(denoms[1],"/ (",paste(denoms,collapse=" + "),")"))))
        }
        
        phi <- calcPhiCoefficient("Student",vcomp,vcompLbls,counts)
        cat("Φ =", substr(sprintf("%.3f",round(phi,3)),2,5))
    
    })




################################################
# D study
################################################

    D <- reactive({
    
    
        if (input$type == "pi") {

            model <- mod()$model
    
            vcomp <- VarCorr(model)
        
            dat <- read.csv(text=input$text, sep="\t")
            
            dat$Student <- factor(rownames(dat)) # id番号付与
            col.n <- length(dat)-1
            dat <- reshape(dat, idvar="Student", varying=2:col.n, v.names="Score", direction = "long")
            dat <- dat[,-1]
            colnames(dat) <- c("Student", "Item", "Score")
            dat$Item <- factor(dat$Item)
            
            counts <- length(levels(dat$Item))
            names(counts) <- c("Item")
            
            vcomp <- VarCorr(model)
            vcompLbls <- c("Student","Item")
    
    
        } else { # in case of "pri"

            model <- mod()$model

            vcomp <- VarCorr(model)

            dat <- read.csv(text=input$text, sep="\t")

            dat$Student <- factor(dat$Student)
            dat$Rater <- factor(dat$Rater)
            dat$Item <- factor(dat$Item)

            counts <- list(length(levels(dat$Rater)),length(levels(dat$Item)))
            names(counts) <- c("Rater","Item")

            vcompLbls <- c("Student","Rater","Item","Student:Rater","Student:Item","Item:Rater")

        }




        calcGCoefficient <- function(uniVal,vcomp,vcompLbls,ids,counts) {
            denoms <- c()
            denomsVal <- c()
            denoms[1] <- "as.numeric(vcomp[[uniVal]])"
            denomsVal[1] <- as.numeric(vcomp[[uniVal]])
            if (length(ids) > 0) {
                for(i in 1:length(ids)) {
                    denomItem <- gsub(paste(":",uniVal,"|",uniVal,":",sep=""),"",vcompLbls[ids[i]])
                    if (length(grep(":",denomItem)) > 0){
                        items <- strsplit(denomItem,":")
                        countNums <- c()
                        for (j in 1:length(items[[1]])) {
                            countNums[j] <- counts[[items[[1]][j]]]
                        }
                        denoms[i+1] <- paste('(as.numeric(vcomp[[vcompLbls[ids[',i,']]]]) / ',prod(countNums),')',sep="")
                        denomsVal[i+1] <- as.numeric(vcomp[[vcompLbls[ids[i]]]]) / prod(countNums)
                    } else {
                        denoms[i+1] <- paste('(as.numeric(vcomp[[vcompLbls[ids[',i,']]]]) / counts[[gsub(paste(":",uniVal,"|",uniVal,":",sep=""),"",vcompLbls[ids[',i,']])]])',sep="")
                        denomsVal[i+1] <- as.numeric(vcomp[[vcompLbls[ids[i]]]]) / counts[[gsub(paste(":",uniVal,"|",uniVal,":",sep=""),"",vcompLbls[ids[i]])]]
                    }
                }
            }
        
            countNums <- c()
            for (i in 1:length(counts)) {
                countNums[i] <- counts[[i]]
            }
            denoms[length(denoms) + 1] <- '(attr(vcomp, "sc")[[1]]^2 / prod(countNums))'
            denomsVal[length(denomsVal) + 1] <- attr(vcomp, "sc")[[1]]^2 / prod(countNums)
            return(eval(parse(text=paste(denoms[1],"/ (",paste(denoms,collapse=" + "),")"))))
        }
        
        
        
        
        
        
        if (input$type == "pi") {
            
            n.items <- input$n.items
            
            ival <- 1:n.items
            ival <- as.numeric(ival)
            
            plotValsG <- c()
            plotVals <- c()
                for(i in 1:length(ival)) {
                    counts[[1]] <- ival[i]
                    plotValsG[i] <- calcGCoefficient("Student",vcomp,vcompLbls,grep(":Student\\b|\\bStudent:",vcompLbls),counts)
                }
            
            cat("G-coefficients\n\n")
            gvals <- data.frame(substr(matrix(sprintf("%.3f",round(plotValsG,3)),ncol=1),2,5))
            colnames(gvals) <- c("G-coefficients")
            rownames(gvals) <- paste("Item","=",ival)
            print(gvals)
        
        
        } else { # in case of "pri"

            n.raters <- input$n.raters
            n.items <- input$n.items
        
            ival <- 1:n.raters
            ival <- as.numeric(ival)
            jval <- 1:n.items
            jval <- as.numeric(jval)
            
            if(length(counts) > 1) {
                plotValsG <- matrix(nrow=length(ival),ncol=length(jval))
                    for(i in 1:length(ival)) {
                        for(j in 1:length(jval)) {
                            counts[[1]] <- ival[i]
                            counts[[2]] <- jval[j]
                            plotValsG[i,j] <- calcGCoefficient("Student",vcomp,vcompLbls,grep(":Student\\b|\\bStudent:",vcompLbls),counts)
                        }
            }
            
            cat("G-coefficients (row: Rater, column: Item)\n\n")
            gvals <- data.frame(substr(matrix(sprintf("%.3f",round(plotValsG,3)),ncol=ncol(plotValsG)),2,5))
            colnames(gvals) <- jval
            rownames(gvals) <- paste("Rater","=",ival)
            print(gvals)
            
            }
      
        }
        
    })




################################################
# plot
################################################

    makePlot <- function(){
        
        
        if (input$type == "pi") {
            
            model <- mod()$model
            
            vcomp <- VarCorr(model)
            
            dat <- read.csv(text=input$text, sep="\t")
            
            dat$Student <- factor(rownames(dat)) # id番号付与
            col.n <- length(dat)-1
            dat <- reshape(dat, idvar="Student", varying=2:col.n, v.names="Score", direction = "long")
            dat <- dat[,-1]
            colnames(dat) <- c("Student", "Item", "Score")
            dat$Item <- factor(dat$Item)
            
            counts <- length(levels(dat$Item))
            names(counts) <- c("Item")
            
            vcomp <- VarCorr(model)
            vcompLbls <- c("Student","Item")
            
            
        } else { # in case of "pri"
            
            model <- mod()$model
            
            vcomp <- VarCorr(model)
            
            dat <- read.csv(text=input$text, sep="\t")
            
            dat$Student <- factor(dat$Student)
            dat$Rater <- factor(dat$Rater)
            dat$Item <- factor(dat$Item)
            
            counts <- list(length(levels(dat$Rater)),length(levels(dat$Item)))
            names(counts) <- c("Rater","Item")
            
            vcompLbls <- c("Student","Rater","Item","Student:Rater","Student:Item","Item:Rater")
            
        }
        
        
        
        
        calcGCoefficient <- function(uniVal,vcomp,vcompLbls,ids,counts) {
            denoms <- c()
            denomsVal <- c()
            denoms[1] <- "as.numeric(vcomp[[uniVal]])"
            denomsVal[1] <- as.numeric(vcomp[[uniVal]])
            if (length(ids) > 0) {
                for(i in 1:length(ids)) {
                    denomItem <- gsub(paste(":",uniVal,"|",uniVal,":",sep=""),"",vcompLbls[ids[i]])
                    if (length(grep(":",denomItem)) > 0){
                        items <- strsplit(denomItem,":")
                        countNums <- c()
                        for (j in 1:length(items[[1]])) {
                            countNums[j] <- counts[[items[[1]][j]]]
                        }
                        denoms[i+1] <- paste('(as.numeric(vcomp[[vcompLbls[ids[',i,']]]]) / ',prod(countNums),')',sep="")
                        denomsVal[i+1] <- as.numeric(vcomp[[vcompLbls[ids[i]]]]) / prod(countNums)
                    } else {
                        denoms[i+1] <- paste('(as.numeric(vcomp[[vcompLbls[ids[',i,']]]]) / counts[[gsub(paste(":",uniVal,"|",uniVal,":",sep=""),"",vcompLbls[ids[',i,']])]])',sep="")
                        denomsVal[i+1] <- as.numeric(vcomp[[vcompLbls[ids[i]]]]) / counts[[gsub(paste(":",uniVal,"|",uniVal,":",sep=""),"",vcompLbls[ids[i]])]]
                    }
                }
            }
            
            countNums <- c()
            for (i in 1:length(counts)) {
                countNums[i] <- counts[[i]]
            }
            denoms[length(denoms) + 1] <- '(attr(vcomp, "sc")[[1]]^2 / prod(countNums))'
            denomsVal[length(denomsVal) + 1] <- attr(vcomp, "sc")[[1]]^2 / prod(countNums)
            return(eval(parse(text=paste(denoms[1],"/ (",paste(denoms,collapse=" + "),")"))))
        }
        
        
        
        
        
        
        if (input$type == "pi") {
            
            n.items <- input$n.items
            
            ival <- 1:n.items
            ival <- as.numeric(ival)
            
            plotValsG <- c()
            plotVals <- c()
            for(i in 1:length(ival)) {
                counts[[1]] <- ival[i]
                plotValsG[i] <- calcGCoefficient("Student",vcomp,vcompLbls,grep(":Student\\b|\\bStudent:",vcompLbls),counts)
            }
            
            cat("G-coefficients (row: Rater, column: Item)\n\n")
            gvals <- data.frame(substr(matrix(sprintf("%.3f",round(plotValsG,3)),ncol=1),2,5))
            colnames(gvals) <- c("G-coefficients")
            rownames(gvals) <- paste("Rater","=",ival)
            
            plot(c(0,0),xlim=c(min(ival),max(ival)),ylim=c(0, 1),type="n",xlab="Items",ylab="G-coefficients")
            axis(side=2, at=c(0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1))
            axis(side=1, at=ival)
            points(plotValsG, pch=1, col=1);lines(plotValsG, col=1, lty=1)
            
            
        } else { # in case of "pri"
            
            n.raters <- input$n.raters
            n.items <- input$n.items
            
            ival <- 1:n.raters
            ival <- as.numeric(ival)
            jval <- 1:n.items
            jval <- as.numeric(jval)
            
            plotValsG <- matrix(nrow=length(ival),ncol=length(jval))
            for(i in 1:length(ival)) {
                for(j in 1:length(jval)) {
                    counts[[1]] <- ival[i]
                    counts[[2]] <- jval[j]
                    plotValsG[i,j] <- calcGCoefficient("Student",vcomp,vcompLbls,grep(":Student\\b|\\bStudent:",vcompLbls),counts)
                }
            }
            
            cat("G-coefficients (row: Rater, column: Item)\n\n")
            gvals <- data.frame(substr(matrix(sprintf("%.3f",round(plotValsG,3)),ncol=ncol(plotValsG)),2,5))
            colnames(gvals) <- jval
            rownames(gvals) <- paste("Rater","=",ival)
            
            lbls <- c()
            for (i in 1:n.raters) {
                lbls[i] <- paste("Rater =",i)
            }
            
            plot(c(0,0),xlim=c(min(jval),max(jval)),ylim=c(0, 1),type="n",xlab="Items",ylab="G-coefficients")
            axis(side=2, at=c(0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1))
            axis(side=1, at=jval)
            legend("topleft", cex=0.7, legend = lbls, lty = c(1:n.raters), pch = c(1:n.raters), col = c(1:n.raters))
            for(i in 1:nrow(plotValsG)) {
                points(plotValsG[i,], pch=i, col=i);lines(plotValsG[i,], col=i, lty=i)
            }
            
        }
        
    }
    
    
    output$Plot <- renderPlot({
        print(makePlot())
    })
    
    



################################################
# R session info
################################################

    info <- reactive({
        info1 <- paste("This analysis was conducted with ", strsplit(R.version$version.string, " \\(")[[1]][1], ".", sep = "")# バージョン情報
        info2 <- paste("It was executed on ", date(), ".", sep = "")# 実行日時
        cat(sprintf(info1), "\n")
        cat(sprintf(info2), "\n")
    })
    
    
    
    
    
################################################
# server.R and ui.R connection
################################################

    output$info.out <- renderPrint({
        info()
    })
    
    
    
    
    
    output$var.est.out <- renderPrint({
        var.est()
    })
    
    output$g.coef.out <- renderPrint({
        g.coef()
    })
    
    output$phi.out <- renderPrint({
        phi()
    })
    
    output$D.out <- renderPrint({
        D()
    })


})
library(shiny)
library(shinyAce)



shinyUI(bootstrapPage(


    headerPanel("Generalizability Theory"),

        sidebarPanel(

            radioButtons("type", strong("Design (all crossed):"),
                        list("p × i" = "pi",
                             "p × r × i" = "pri") , selected = "pri"

            ),

            br()

        ),



    mainPanel(

        tabsetPanel(

        tabPanel("Main",

            p('Note: Input values must be separated by tabs. Copy and paste from Excel/Numbers.'),

            p(HTML("<b><div style='background-color:#FADDF2;border:1px solid black;'>Your data needs to have exactly the same header (variable names) in the first row.</div></b>")),

            br(),

            aceEditor("text", value="Student\tRater\tItem\tScore\n1\t1\t1\t5\n1\t2\t1\t2\n1\t3\t1\t7\n1\t4\t1\t6\n1\t5\t1\t6\n1\t6\t1\t6\n1\t7\t1\t5\n1\t8\t1\t2\n1\t1\t2\t4\n1\t2\t2\t2\n1\t3\t2\t6\n1\t4\t2\t6\n1\t5\t2\t3\n1\t6\t2\t6\n1\t7\t2\t5\n1\t8\t2\t2\n1\t1\t3\t3\n1\t2\t3\t3\n1\t3\t3\t7\n1\t4\t3\t6\n1\t5\t3\t5\n1\t6\t3\t7\n1\t7\t3\t6\n1\t8\t3\t3\n1\t1\t4\t3\n1\t2\t4\t2\n1\t3\t4\t7\n1\t4\t4\t6\n1\t5\t4\t5\n1\t6\t4\t7\n1\t7\t4\t6\n1\t8\t4\t3\n1\t1\t5\t4\n1\t2\t5\t3\n1\t3\t5\t7\n1\t4\t5\t6\n1\t5\t5\t5\n1\t6\t5\t7\n1\t7\t5\t6\n1\t8\t5\t3\n1\t1\t6\t3\n1\t2\t6\t3\n1\t3\t6\t6\n1\t4\t6\t6\n1\t5\t6\t5\n1\t6\t6\t5\n1\t7\t6\t5\n1\t8\t6\t3\n2\t1\t1\t5\n2\t2\t1\t3\n2\t3\t1\t7\n2\t4\t1\t7\n2\t5\t1\t6\n2\t6\t1\t7\n2\t7\t1\t6\n2\t8\t1\t4\n2\t1\t2\t5\n2\t2\t2\t3\n2\t3\t2\t7\n2\t4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t7\n20\t2\t1\t3\n20\t3\t1\t7\n20\t4\t1\t7\n20\t5\t1\t7\n20\t6\t1\t7\n20\t7\t1\t7\n20\t8\t1\t5\n20\t1\t2\t5\n20\t2\t2\t3\n20\t3\t2\t7\n20\t4\t2\t7\n20\t5\t2\t6\n20\t6\t2\t7\n20\t7\t2\t6\n20\t8\t2\t5\n20\t1\t3\t5\n20\t2\t3\t3\n20\t3\t3\t8\n20\t4\t3\t7\n20\t5\t3\t4\n20\t6\t3\t7\n20\t7\t3\t6\n20\t8\t3\t4\n20\t1\t4\t5\n20\t2\t4\t3\n20\t3\t4\t8\n20\t4\t4\t7\n20\t5\t4\t4\n20\t6\t4\t7\n20\t7\t4\t6\n20\t8\t4\t4\n20\t1\t5\t4\n20\t2\t5\t3\n20\t3\t5\t7\n20\t4\t5\t7\n20\t5\t5\t3\n20\t6\t5\t7\n20\t7\t5\t6\n20\t8\t5\t5\n20\t1\t6\t4\n20\t2\t6\t4\n20\t3\t6\t6\n20\t4\t6\t7\n20\t5\t6\t4\n20\t6\t6\t5\n20\t7\t6\t5\n20\t8\t6\t5",
                mode="r", theme="cobalt"),

            br(),

            h3("Variance components"),

            verbatimTextOutput("var.est.out"),

            br(),

            h3("G-coefficient"),
            verbatimTextOutput("g.coef.out"),

            br(),

            h3("Phi"),
            verbatimTextOutput("phi.out"),

            br(),

            h3("D study"),

            # Display this only if "pri" is checked
            conditionalPanel(condition = "input.type == 'pri'",
                numericInput("n.raters", "Number of raters", 3)
            ),

            numericInput("n.items", "Number of items", 5),

            verbatimTextOutput("D.out"),

            plotOutput("Plot", height = "550px"),

            br(),
            br(),


            strong('R session info'),
            verbatimTextOutput("info.out")
            ),





    tabPanel("Input Examples",

        p('Note: Input values must be separated by tabs. Copy and paste from Excel/Numbers.'),

        p(HTML("<b><div style='background-color:#FADDF2;border:1px solid black;'>Your data needs to have exactly the same header (variable names) in the first row.</div></b>")),

        br(),

        p(strong("p × i Design")),
        aceEditor("text1", value="ID\ti01\ti02\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\n20\t5\t4\t4\n20\t6\t4\t7\n20\t7\t4\t6\n20\t8\t4\t4\n20\t1\t5\t4\n20\t2\t5\t3\n20\t3\t5\t7\n20\t4\t5\t7\n20\t5\t5\t3\n20\t6\t5\t7\n20\t7\t5\t6\n20\t8\t5\t5\n20\t1\t6\t4\n20\t2\t6\t4\n20\t3\t6\t6\n20\t4\t6\t7\n20\t5\t6\t4\n20\t6\t6\t5\n20\t7\t6\t5\n20\t8\t6\t5", mode="r", theme="solarized_light"),


        br()

        ),





        tabPanel("About",

            strong('Note'),
            p('This web application is developed with',
            a("Shiny.", href="http://www.rstudio.com/shiny/", target="_blank"),
            ''),

            br(),

            strong('List of Packages Used'), br(),
            code('library(shiny)'),br(),
            code('library(shinyAce)'),br(),
            code('library(lme4)'),br(),

            br(),

            strong('Code'),
            p('Source code for this application is based on',
            a('"The handbook of Research in Foreign Language Learning and Teaching" (Takeuchi & Mizumoto, 2012)', href='http://mizumot.com/handbook/', target="_blank"), 'and',
            a("MacR.", href="https://sites.google.com/site/casualmacr/", target="_blank")),

            p('The code for this web application is available at',
            a('GitHub.', href='https://github.com/mizumot/g-theory', target="_blank")),

            p('If you want to run this code on your computer (in a local R session), run the code below:',
            br(),
            code('library(shiny)'),br(),
            code('runGitHub("g-theory","mizumot")')
            ),

            br(),

            strong('Citation in Publications'),
            p('Mizumoto, A. (2015). Langtest (Version 1.0) [Web application]. Retrieved from http://langtest.jp'),

            br(),

            strong('Article'),
            p('Mizumoto, A., & Plonsky, L. (2015).', a("R as a lingua franca: Advantages of using R for quantitative research in applied linguistics.", href='http://applij.oxfordjournals.org/content/early/2015/06/24/applin.amv025.abstract', target="_blank"), em('Applied Linguistics,'), 'Advance online publication. doi:10.1093/applin/amv025'),

            br(),

            strong('Recommended'),
            p('To learn more about R, I suggest this excellent and free e-book (pdf),',
            a("A Guide to Doing Statistics in Second Language Research Using R,", href="http://cw.routledge.com/textbooks/9780805861853/guide-to-R.asp", target="_blank"),
            'written by Dr. Jenifer Larson-Hall.'),

            p('Also, if you are a cool Mac user and want to use R with GUI,',
            a("MacR", href="https://sites.google.com/site/casualmacr/", target="_blank"),
            'is defenitely the way to go!'),

            br(),

            strong('Author'),
            p(a("Atsushi MIZUMOTO,", href="http://mizumot.com", target="_blank"),' Ph.D.',br(),
            'Professor of Applied Linguistics',br(),
            'Faculty of Foreign Language Studies /',br(),
            'Graduate School of Foreign Language Education and Research,',br(),
            'Kansai University, Osaka, Japan'),

            br(),

            a(img(src="http://i.creativecommons.org/p/mark/1.0/80x15.png"), target="_blank", href="http://creativecommons.org/publicdomain/mark/1.0/"),

            p(br())

    )
)
)
))
Code license: GPL-3