Skip to content

Commit

Permalink
add test for IV
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieugomez committed Aug 18, 2018
1 parent 5fc055c commit ffeffbb
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
6 changes: 2 additions & 4 deletions .travis.yml
@@ -1,14 +1,12 @@
language: julia
julia:
- 0.7
- 1.0
- nightly
matrix:
allow_failures:
- julia: nightly
script:
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
- julia --check-bounds=yes -e 'Pkg.clone(pwd()); Pkg.build("FixedEffectModels"); Pkg.test("FixedEffectModels"; coverage=true)'
after_success:
- julia -e 'cd(Pkg.dir("FixedEffectModels")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
- julia -e 'using Pkg; cd(Pkg.dir("FixedEffectModels")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
notifications:
email: false
2 changes: 1 addition & 1 deletion REQUIRE
@@ -1,4 +1,4 @@
julia 0.7.0-
julia 0.7
Distributions 0.4.6
StatsBase 0.22.0
StatsModels 0.2.4
Expand Down
8 changes: 4 additions & 4 deletions src/RegressionResult.jl
Expand Up @@ -249,13 +249,13 @@ end

title(::RegressionResultIV) = "IV Model"
top(x::RegressionResultIV) = [
"Number of obs" sprint(show, nobs(x), contect = :compact => true);
"Degrees of freedom" sprint(show, nobs(x) - df_residual(x), contect = :compact => true);
"Number of obs" sprint(show, nobs(x), context = :compact => true);
"Degrees of freedom" sprint(show, nobs(x) - df_residual(x), context = :compact => true);
"R2" format_scientific(x.r2);
"R2 Adjusted" format_scientific(x.r2_a);
"F-Statistic" sprint(show, x.F, contect = :compact => true);
"F-Statistic" sprint(show, x.F, context = :compact => true);
"p-value" format_scientific(x.p);
"First Stage F-stat (KP)" sprint(show, x.F_kp, contect = :compact => true);
"First Stage F-stat (KP)" sprint(show, x.F_kp, context = :compact => true);
"First Stage p-val (KP)" format_scientific(x.p_kp);
]

Expand Down
1 change: 0 additions & 1 deletion src/fixedeffect/FixedEffect.jl
Expand Up @@ -113,7 +113,6 @@ function getindex(x::FixedEffect, idx)
refs = x.refs[idx]
sqrtw = x.sqrtw[idx]
interaction = x.interaction[idx]

scale = copy(x.scale)
for i in 1:length(refs)
scale[refs[i]] += abs2(interaction[i] * sqrtw[i])
Expand Down
1 change: 1 addition & 0 deletions test/RegressionResult.jl
Expand Up @@ -15,6 +15,7 @@ residuals(result, df)

model = @model Sales ~ CPI + (Price ~ Pimin)
result = reg(df, model)
show(result)
predict(result, df)
residuals(result, df)
model_response(result, df)
Expand Down

0 comments on commit ffeffbb

Please sign in to comment.