Skip to content

Comments

Update ANOVA.jl, fixing line 7#2

Open
DanielEWeeks wants to merge 2 commits intoKennethLange:masterfrom
DanielEWeeks:master
Open

Update ANOVA.jl, fixing line 7#2
DanielEWeeks wants to merge 2 commits intoKennethLange:masterfrom
DanielEWeeks:master

Conversation

@DanielEWeeks
Copy link

I think this simple change may suffice to fix the precompilation issue I reported in this GitHub Issue:

#1

Change line 7 of ANOVA.jl from

(alpha, beta) = (sum(S, dims = 2), beta = sum(S, dims = 1))

to

(alpha, beta) = (alpha = sum(S, dims = 2), beta = sum(S, dims = 1))
julia> function two_way_ANOVA(Y::Array{T, 3}) where T <: Real
         (i, j, k) = size(Y)
         S = sum(Y, dims = 3)
         (alpha, beta) = (sum(S, dims = 2), beta = sum(S, dims = 1))
         mu = sum(alpha) / (i * j * k)
         alpha = alpha / (j * k) .- mu
         beta = beta / (i * k) .- mu
         return (mu, alpha, beta)
       end
ERROR: syntax: invalid named tuple element "sum(S, dims = 2)" around REPL[31]:4
Stacktrace:
 [1] top-level scope
   @ REPL[31]:1

julia> function two_way_ANOVA(Y::Array{T, 3}) where T <: Real
         (i, j, k) = size(Y)
         S = sum(Y, dims = 3)
         (alpha, beta) = (alpha=sum(S, dims = 2), beta = sum(S, dims = 1))
         mu = sum(alpha) / (i * j * k)
         alpha = alpha / (j * k) .- mu
         beta = beta / (i * k) .- mu
         return (mu, alpha, beta)
       end
two_way_ANOVA (generic function with 1 method)

Change line 40 to use the dot operator:

```
    errors = count(class - imputedclass .!= 0);
```
See KennethLange#3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant