We couldn't get a solution with the data we use, I wonder if we are editing the data incorrectly or if we have a coding error, please help.
. import excel "C:\Users\Akkaraaslan\Desktop\nested son yil veri.xlsx", sheet("Sayfa1") firstrow
. tab x25
x25 | Freq. Percent Cum.
------------+-----------------------------------
1 | 11,515 16.67 16.67
2 | 11,515 16.67 33.33
3 | 11,515 16.67 50.00
4 | 11,515 16.67 66.67
5 | 11,515 16.67 83.33
6 | 11,515 16.67 100.00
------------+-----------------------------------
Total | 69,090 100.00
. nlogitgen type = x25(ypn: 1|2|3|4|5,ypmyn:6)
new variable type is generated with 2 groups
label list lb_type
lb_type:
1 ypn
2 ypmyn
. nlogittree x25 type, choice( __didep ) case( __strata )
tree structure specified for the nested logit model
type N x25 N k
---------------------------------
ypn 57575 --- 1 11515 485
|- 2 11515 503
|- 3 11515 845
|- 4 11515 149
+- 5 11515 592
ypmyn 11515 --- 6 11515 8941
---------------------------------
total 69090 11515
k = number of times alternative is chosen
N = number of observations at each level
Note: At least one case has only one alternative; nlogit will drop these cases.
. nlogit __didep x28u ib1.x6u || type: x28 x3 , base(ypmyn) || x25:, noconstant case( __strata )
note: variable 2.x6u has 1993 cases that are not alternative-specific: there is no within-case variability
note: variable 3.x6u has 9914 cases that are not alternative-specific: there is no within-case variability
note: branch 2 of level 1 is degenerate and the associated dissimilarity parameter ([ypmyn_tau]_cons) is not defined; see help
nlogit for details
tree structure specified for the nested logit model
type N x25 N k
---------------------------------
ypn 57575 --- 1 11515 485
|- 2 11515 503
|- 3 11515 845
|- 4 11515 149
+- 5 11515 592
ypmyn 11515 --- 6 11515 8941
---------------------------------
total 69090 11515
k = number of times alternative is chosen
N = number of observations at each level
note: clogit model failed; null likelihood is invalid
note: the LR test for IIA will not be computed
Iteration 0: log likelihood = 5.688e-14
Iteration 1: log likelihood = 6.393e-14
Iteration 2: log likelihood = 6.488e-14
BFGS stepping has contracted, resetting BFGS Hessian
Iteration 3: log likelihood = 6.488e-14
BFGS stepping has contracted, resetting BFGS Hessian
Iteration 4: log likelihood = 6.488e-14
BFGS stepping has contracted, resetting BFGS Hessian
Iteration 5: log likelihood = 6.488e-14
BFGS stepping has contracted, resetting BFGS Hessian
Iteration 6: log likelihood = 6.488e-14
BFGS stepping has contracted, resetting BFGS Hessian
Iteration 7: log likelihood = 6.488e-14
BFGS stepping has contracted, resetting BFGS Hessian
Iteration 8: log likelihood = 6.488e-14
BFGS stepping has contracted, resetting BFGS Hessian
Iteration 9: log likelihood = 6.488e-14
BFGS stepping has contracted, resetting BFGS Hessian
Iteration 10: log likelihood = 6.488e-14
BFGS stepping has contracted, resetting BFGS Hessian
Iteration 11: log likelihood = 6.488e-14
BFGS stepping has contracted, resetting BFGS Hessian
Iteration 12: log likelihood = 6.488e-14
cannot compute an improvement -- flat region encountered
r(430);
. import excel "C:\Users\Akkaraaslan\Desktop\nested son yil veri.xlsx", sheet("Sayfa1") firstrow
. tab x25
x25 | Freq. Percent Cum.
------------+-----------------------------------
1 | 11,515 16.67 16.67
2 | 11,515 16.67 33.33
3 | 11,515 16.67 50.00
4 | 11,515 16.67 66.67
5 | 11,515 16.67 83.33
6 | 11,515 16.67 100.00
------------+-----------------------------------
Total | 69,090 100.00
. nlogitgen type = x25(ypn: 1|2|3|4|5,ypmyn:6)
new variable type is generated with 2 groups
label list lb_type
lb_type:
1 ypn
2 ypmyn
. nlogittree x25 type, choice( __didep ) case( __strata )
tree structure specified for the nested logit model
type N x25 N k
---------------------------------
ypn 57575 --- 1 11515 485
|- 2 11515 503
|- 3 11515 845
|- 4 11515 149
+- 5 11515 592
ypmyn 11515 --- 6 11515 8941
---------------------------------
total 69090 11515
k = number of times alternative is chosen
N = number of observations at each level
Note: At least one case has only one alternative; nlogit will drop these cases.
. nlogit __didep x28u ib1.x6u || type: x28 x3 , base(ypmyn) || x25:, noconstant case( __strata )
note: variable 2.x6u has 1993 cases that are not alternative-specific: there is no within-case variability
note: variable 3.x6u has 9914 cases that are not alternative-specific: there is no within-case variability
note: branch 2 of level 1 is degenerate and the associated dissimilarity parameter ([ypmyn_tau]_cons) is not defined; see help
nlogit for details
tree structure specified for the nested logit model
type N x25 N k
---------------------------------
ypn 57575 --- 1 11515 485
|- 2 11515 503
|- 3 11515 845
|- 4 11515 149
+- 5 11515 592
ypmyn 11515 --- 6 11515 8941
---------------------------------
total 69090 11515
k = number of times alternative is chosen
N = number of observations at each level
note: clogit model failed; null likelihood is invalid
note: the LR test for IIA will not be computed
Iteration 0: log likelihood = 5.688e-14
Iteration 1: log likelihood = 6.393e-14
Iteration 2: log likelihood = 6.488e-14
BFGS stepping has contracted, resetting BFGS Hessian
Iteration 3: log likelihood = 6.488e-14
BFGS stepping has contracted, resetting BFGS Hessian
Iteration 4: log likelihood = 6.488e-14
BFGS stepping has contracted, resetting BFGS Hessian
Iteration 5: log likelihood = 6.488e-14
BFGS stepping has contracted, resetting BFGS Hessian
Iteration 6: log likelihood = 6.488e-14
BFGS stepping has contracted, resetting BFGS Hessian
Iteration 7: log likelihood = 6.488e-14
BFGS stepping has contracted, resetting BFGS Hessian
Iteration 8: log likelihood = 6.488e-14
BFGS stepping has contracted, resetting BFGS Hessian
Iteration 9: log likelihood = 6.488e-14
BFGS stepping has contracted, resetting BFGS Hessian
Iteration 10: log likelihood = 6.488e-14
BFGS stepping has contracted, resetting BFGS Hessian
Iteration 11: log likelihood = 6.488e-14
BFGS stepping has contracted, resetting BFGS Hessian
Iteration 12: log likelihood = 6.488e-14
cannot compute an improvement -- flat region encountered
r(430);
Comment