-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect Default Coding of Union{Missing, Int or Float64} #145
Comments
Note that if you pass julia> modelcols(apply_schema(f, schema(f, df, Dict(:zm => ContinuousTerm)), StatisticalModel), df)[2]
10×2 Array{Float64,2}:
1.0 1.0
1.0 2.0
1.0 2.0
1.0 3.0
1.0 3.0
1.0 3.0
1.0 3.0
1.0 2.0
1.0 3.0
1.0 1.0 That being said, it might make sense to widen the criterion for whether something is continuous or not to be |
Actually, if there are any missing values it will error: julia> df.zm[2] = missing
missing
julia> modelcols(apply_schema(f, schema(f, df, Dict(:zm => ContinuousTerm)), StatisticalModel), df)[2]
ERROR: MethodError: no method matching copy(::Missing) |
Still, the issue is what happens when the variable is using DataFrames
df = DataFrame(y = [missing, 1, 2])
idx = completecases(df)
subdf = df[idx, :] |
This. A lot of my regression code follows a similar pattern before getting the model matrix. Also worth pointing out that the old pattern of Moreover, I really like how |
I think it makes sense to treat |
Note that for now using StatsModels
N = 10_000_000
x = rand(N) + rand([0, missing], N)
df = (x = x,)
schema(Term(:x), df)
#julia(20271,0x116991dc0) malloc: can't allocate region
#:*** mach_vm_map(size=199992320073728, flags: 60000100) failed (error code=3)
#julia(20271,0x116991dc0) malloc: *** set a breakpoint in malloc_error_break to debug
#141 ERROR: OutOfMemoryError( |
@matthieugomez That's not too surprising given the underlying issue (and how it expands out), but thanks for the example. |
yes, just connecting it to FixedEffects/FixedEffectModels.jl#99 |
Pretty straight forward. I would expect the results of these to be the same:
OUTPUT:
The text was updated successfully, but these errors were encountered: