ETA

Discuss statistics related things
Post Reply
rhys_lauren
Posts: 1
Joined: Sun Oct 03, 2021 6:46 am

ETA

Post by rhys_lauren »

Hello. I'm new in jamovi. I would just like to ask, can this app solve ETA? not the ETA squared related to ANOVA.. just the ETA correlation.. I'm quite lost in this part of my research.
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: ETA

Post by jonathon »

that's not something i'm familiar with, but someone else might be able to help out.

jonathon
User avatar
MAgojam
Posts: 421
Joined: Thu Jun 08, 2017 2:33 pm
Location: Parma (Italy)

Re: ETA

Post by MAgojam »

Hi, @rhys_lauren.

In Jamovi, there is the Rj Module (the Swiss Army knife), where with a little R code you can get what you need, if at the moment it is not available to click and go.
I'll give you the code with this simple function (can be improved) to get the ETA you are looking for.

Code: Select all

eta <- function(f, y, na.rm = FALSE) {
    if (is.factor(f))   # convert factor to numeric in case it is a factor
        f <- as.numeric(f)
    
    if (!(is.vector(f) & is.vector(y))) 
        stop("'f' must be vectors or a factor, 'y' must be a vector", call. = FALSE)
    
    if (na.rm) {
        i <- !(is.na(f) | is.na(y))  # listwise deletion for NAs
        f <- f[i]
        y <- y[i]
    }

    enne    <- tapply(y, f, FUN = length)
    ymedio  <- tapply(y, f, FUN = mean)
    my_eta  <- sum((ymedio - mean(y))^2 * enne)/sum((y - mean(y))^2)
    
    cat('eta =', my_eta)
}
Copy and paste into the Rj editor and use it with your variables as you can see in the attached screenshot.
ETA.png
ETA.png (64.12 KiB) Viewed 6540 times
Cheers,
Maurizio
Post Reply