Skip to content

Commit

Permalink
Test and fix #128, fix #129
Browse files Browse the repository at this point in the history
314 tests pass
  • Loading branch information
korenmiklos committed Jul 10, 2024
1 parent b0c8518 commit 274e44f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/commands.jl
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,20 @@ end
@test r.coef [2.000000000000003, 2.9999999999999996, 0.9999999999999998, 5.124106267500724e-17]
end
end

@testset "Missing values" begin
df = DataFrame(x=[1, 1, missing, 3, 3, 3], y=[0, 0, 0, 1, 1, 1])
r = @with df @regress y x
@test r.nobs == 5
@test r.coef [-0.5, 0.5]
df = DataFrame(x=[1, 1, 0, exp(1), exp(1), exp(1)], y=[0, 0, 0, 1, 1, 1])
r = @with df @regress y log(x)
@test r.nobs == 5
@test r.coef [0.0, 1.0]
r = @with df @regress log(x) y
@test r.nobs == 5
@test r.coef [0.0, 1.0]
end
end

@testset "Tabulate" begin
Expand Down

0 comments on commit 274e44f

Please sign in to comment.