Skip to content

Commit c923a79

Browse files
authored
Merge pull request #66 from junder873/master
Update for FixedEffectModels 1.13
2 parents 21a419e + 5ad0bdf commit c923a79

4 files changed

Lines changed: 26 additions & 25 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
version:
19-
- '1.9' # Replace this with the minimum Julia version that your package supports. E.g. if your package requires Julia 1.5 or higher, change this to '1.5'.
19+
- '1.10' # Replace this with the minimum Julia version that your package supports. E.g. if your package requires Julia 1.5 or higher, change this to '1.5'.
2020
- '1' # Leave this line unchanged. '1' will automatically expand to the latest stable 1.x release of Julia.
2121
os:
2222
- ubuntu-latest

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "GLFixedEffectModels"
22
uuid = "bafb0ae5-e5f5-5100-81b6-6a55d777c812"
33
authors = ["Johannes Boehm <johannes.boehm@gmail.com>"]
4-
version = "0.5.5"
4+
version = "0.5.6"
55

66
[deps]
77
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
@@ -33,4 +33,4 @@ StatsAPI = "1"
3333
StatsBase = "0.33, 0.34"
3434
StatsModels = "0.6, 0.7"
3535
Vcov = "0.7, 0.8"
36-
julia = "^1.9"
36+
julia = "^1.10"

src/fit.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ function nlreg(@nospecialize(df),
154154
if has_fes
155155
if drop_singletons
156156
before_n = sum(esample)
157-
FixedEffectModels.drop_singletons!(esample, fes, nthreads)
157+
FixedEffectModels.drop_singletons!(esample, fes)
158158
after_n = sum(esample)
159159
dropped_n = before_n - after_n
160160
if dropped_n > 0

test/separation.jl

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -59,35 +59,35 @@ url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/guides/cs
5959
df = DataFrame(CSV.File(Downloads.download(url)))
6060
res1 = nlreg(df, @formula(y ~ x1 + fe(i) + fe(j)), Poisson(), LogLink() ; separation = [:ReLU])
6161

62-
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/test/separation_datasets/01.csv"
62+
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/guides/separation_datasets/01.csv"
6363
df = DataFrame(CSV.File(Downloads.download(url)))
6464
res1 = nlreg(df, @formula(y ~ x1 + x2 + fe(id1) + fe(id2)), Poisson(), LogLink() ; separation = [:ReLU])
6565
@test all(df.separated .== .~res1.esample)
6666

67-
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/test/separation_datasets/02.csv"
67+
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/guides/separation_datasets/02.csv"
6868
df = DataFrame(CSV.File(Downloads.download(url)))
6969
res1 = nlreg(df, @formula(y ~ fe(id1) + fe(id2)), Poisson(), LogLink() ; drop_singletons = false, separation = [:ReLU])
7070
@test all(df.separated .== .~res1.esample)
7171

72-
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/test/separation_datasets/03.csv"
72+
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/guides/separation_datasets/03.csv"
7373
df = DataFrame(CSV.File(Downloads.download(url)))
7474
res1 = nlreg(df, @formula(y ~ fe(id1) + fe(id2) + fe(id3)), Poisson(), LogLink() ; separation = [:ReLU])
7575
@test all(df.separated .== .~res1.esample)
7676

77-
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/test/separation_datasets/04.csv"
77+
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/guides/separation_datasets/04.csv"
7878
df = DataFrame(CSV.File(Downloads.download(url)))
7979
res1 = nlreg(df, @formula(y ~ fe(id1) + fe(id2)), Poisson(), LogLink() ; separation = [:ReLU])
8080
# don't test on the last ob because it was a singleton instead of a separation
8181
@test all(df.separated[1:end-1] .== .~res1.esample[1:end-1])
8282

83-
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/test/separation_datasets/05.csv"
83+
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/guides/separation_datasets/05.csv"
8484
df = DataFrame(CSV.File(Downloads.download(url)))
8585
# add one fixed effect that is basically a intercept, because nlreg won't run without fe
8686
df.id = ones(size(df,1))
8787
res1 = nlreg(df, @formula(y ~ x1 + x2 + x3 + x4 + fe(id)), Poisson(), LogLink() ; separation = [:ReLU])
8888
@test all(df.separated .== .~res1.esample)
8989

90-
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/test/separation_datasets/06.csv"
90+
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/guides/separation_datasets/06.csv"
9191
df = DataFrame(CSV.File(Downloads.download(url)))
9292
# add one fixed effect that is basically a intercept, because nlreg won't run without fe
9393
df.id = ones(size(df,1))
@@ -105,71 +105,72 @@ when setting ppmlhdfe sep as sep(ir), the output is:
105105
(ReLU method dropped 1 separated observation in 2 iterations)
106106
and the output gives ill results too.
107107
108-
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/test/separation_datasets/07.csv"
108+
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/guides/separation_datasets/07.csv"
109109
df = DataFrame(CSV.File(Downloads.download(url)))
110110
res1 = nlreg(df, @formula(y ~ x1 + x2 + fe(id1) + fe(id2)), Poisson(), LogLink() ; drop_singletons = false, separation = [:ReLU])
111111
@test all(df.separated .== .~res1.esample)
112112
=#
113113

114-
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/test/separation_datasets/08.csv"
114+
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/guides/separation_datasets/08.csv"
115115
df = DataFrame(CSV.File(Downloads.download(url)))
116116
res1 = nlreg(df, @formula(y ~ x1 + x2 + fe(id1) + fe(id2)), Poisson(), LogLink() ; separation = [:ReLU])
117117
@test all(df.separated .== .~res1.esample)
118118

119-
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/test/separation_datasets/09.csv"
119+
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/guides/separation_datasets/09.csv"
120120
df = DataFrame(CSV.File(Downloads.download(url)))
121121
# add one fixed effect that is basically a intercept, because nlreg won't run without fe
122122
df.id = ones(size(df,1))
123123
res1 = nlreg(df, @formula(y ~ x1 + x2 + x3 + fe(id)), Poisson(), LogLink() ; separation = [:ReLU])
124124
@test all(df.separated .== .~res1.esample)
125125

126-
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/test/separation_datasets/10.csv"
126+
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/guides/separation_datasets/10.csv"
127127
df = DataFrame(CSV.File(Downloads.download(url)))
128128
df.id = ones(size(df,1))
129129
res1 = nlreg(df, @formula(y ~ x1 + x2 + x3 + fe(id)), Poisson(), LogLink() ; separation = [:ReLU])
130130
@test all(df.separated .== .~res1.esample)
131131

132-
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/test/separation_datasets/11.csv"
132+
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/guides/separation_datasets/11.csv"
133133
df = DataFrame(CSV.File(Downloads.download(url)))
134134
df.id = ones(size(df,1))
135135
res1 = nlreg(df, @formula(y ~ x1 + fe(id)), Poisson(), LogLink() ; separation = [:ReLU])
136136
@test all(df.separated .== .~res1.esample)
137137

138-
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/test/separation_datasets/12.csv"
138+
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/guides/separation_datasets/12.csv"
139139
df = DataFrame(CSV.File(Downloads.download(url)))
140140
res1 = nlreg(df, @formula(y ~ fe(id1) + fe(id2)), Poisson(), LogLink() ; drop_singletons = false , separation = [:ReLU])
141141
@test all(df.separated .== .~res1.esample)
142142

143-
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/test/separation_datasets/13.csv"
144-
df = DataFrame(CSV.File(Downloads.download(url)))
145-
res1 = nlreg(df, @formula(y ~ fe(id1) + fe(id2)), Poisson(), LogLink() ; drop_singletons = false , separation = [:ReLU])
146-
@test all(df.separated .== .~res1.esample)
143+
# original 13 no longer exists
144+
# url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/guides/separation_datasets/13.csv"
145+
# df = DataFrame(CSV.File(Downloads.download(url)))
146+
# res1 = nlreg(df, @formula(y ~ fe(id1) + fe(id2)), Poisson(), LogLink() ; drop_singletons = false , separation = [:ReLU])
147+
# @test all(df.separated .== .~res1.esample)
147148

148-
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/test/separation_datasets/14.csv"
149+
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/guides/separation_datasets/13.csv"
149150
df = DataFrame(CSV.File(Downloads.download(url)))
150151
df.id = ones(size(df,1))
151152
res1 = nlreg(df, @formula(y ~ x1 + x2 + fe(id)), Poisson(), LogLink() ; separation = [:ReLU])
152153
@test all(df.separated .== .~res1.esample)
153154

154-
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/test/separation_datasets/15.csv"
155+
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/guides/separation_datasets/14.csv"
155156
df = DataFrame(CSV.File(Downloads.download(url)))
156157
df.id = ones(size(df,1))
157158
res1 = nlreg(df, @formula(y ~ x1 + x2 + x3 + fe(id)), Poisson(), LogLink() ; separation = [:ReLU])
158159
@test all(df.separated .== .~res1.esample)
159160

160-
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/test/separation_datasets/16.csv"
161+
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/guides/separation_datasets/15.csv"
161162
df = DataFrame(CSV.File(Downloads.download(url)))
162163
df.id = ones(size(df,1))
163164
res1 = nlreg(df, @formula(y ~ x1 + x2 + x3 + fe(id)), Poisson(), LogLink() ; separation = [:ReLU])
164165
@test all(df.separated .== .~res1.esample)
165166

166-
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/test/separation_datasets/17.csv"
167+
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/guides/separation_datasets/16.csv"
167168
df = DataFrame(CSV.File(Downloads.download(url)))
168169
df.id = ones(size(df,1))
169170
res1 = nlreg(df, @formula(y ~ x1 + x2 + x3 + fe(id)), Poisson(), LogLink() ; separation = [:ReLU])
170171
@test all(df.separated .== .~res1.esample)
171172

172-
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/test/separation_datasets/18.csv"
173+
url = "https://raw.githubusercontent.com/sergiocorreia/ppmlhdfe/master/guides/separation_datasets/17.csv"
173174
df = DataFrame(CSV.File(Downloads.download(url)))
174175
df.id = ones(size(df,1))
175176
res1 = nlreg(df, @formula(y ~ x1 + x2 + x3 + fe(id)), Poisson(), LogLink() ; separation = [:ReLU])

0 commit comments

Comments
 (0)