piever / AcceleratedFailure.jl

Survival analysis in Julia
Other
7 stars 0 forks source link

runtest #2

Open alexhallam opened 7 years ago

alexhallam commented 7 years ago

Hi there,

I was interested in writing a KM tests for this package, but I got the following error

julia> include("runtests.jl")
INFO: Recompiling stale cache file /Users/alexhallam/.julia/lib/v0.5/CSV.ji for module CSV.
INFO: Precompiling module JLD.
WARNING: could not import Base.lastidx into LegacyStrings
ERROR: LoadError: LoadError: UndefVarError: Event not defined
 in #3 at ./<missing>:0 [inlined]
 in next at ./generator.jl:26 [inlined]
 in collect(::Base.Generator{UnitRange{Int64},##3#4}) at ./array.jl:307
 in include_from_node1(::String) at ./loading.jl:488
 in include_from_node1(::String) at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib:?
 in include_from_node1(::String) at ./loading.jl:488
 in include_from_node1(::String) at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib:?
while loading /Users/alexhallam/Desktop/Survival.jl/test/aft_test.jl, in expression starting on line 8
while loading /Users/alexhallam/Desktop/Survival.jl/test/runtests.jl, in expression starting on line 12

Would you know anything about what the bug is?

piever commented 7 years ago

Hi! What happens if you run Pkg.test("Survival") in the REPL instead? Does that work? Also, are you on master and up to date?

Given that Survival defines and exports Event, the only thing that I can imagine is that you are simultaneously using another package which also has Event and it comes out as undefined because Julia doesn't know which one to use. Pkg.test("Survival") should start a separate julia session so this is no problem. If you want to use several survival packages at once, you need to specify Survival.Event when defining some variable of that type.

Also, if the name is conflicting with stuff that other people use, I should probably take Event away altogether and only use EventWindow.

alexhallam commented 7 years ago

Pkg.test("Survival") did it! Thanks. Would you me okay if I check that KM-curves are the same as the KM-curves in R?

piever commented 7 years ago

Yes, that sounds great. Please save the full output of what R gives you, because I plan on adding the remaining features (at least the standard error). I'd also be curious to know what terminology R uses to call these functions.

alexhallam commented 7 years ago

No problem. Also, the survival package in R is very object oriented. I think that the survival package here was trying to follow the same kind of terminology as R.