I am using runmlwin within Stata(15.1) in macOS (High Sierra).

Referring to Lemma 7.5, I am trying to plot the country prediction lines for the random slope (in my case Internal Efficacy). However, I cannot see explicit 'fanning in' given the covariance is negative. Any help would be greatly appreciated.

Here is my code:

Code: Select all

```
set seed 123
sort cntry_n ind
quietly runmlwin vote cons female_c uemp_c yhh_c eisced_c rlgdgr_c lrscale_c polintr_c ///
Inteff_c Exteff_c ///
dependency_c neet_c vtolder, ///
level2(cntry_n: cons Inteff_c) level1(ind:) ///
discrete(distribution(binomial) link(logit) denom(cons) pql2)
runmlwin vote cons female_c uemp_c yhh_c eisced_c rlgdgr_c lrscale_c polintr_c ///
Inteff_c Exteff_c ///
dependency_c neet_c vtolder, ///
level2(cntry_n: cons Inteff_c, residuals(u) level1(ind:) ///
discrete(distribution(binomial) link(logit) denom(cons)) ///
mcmc(orthogonal) or initsprevious nopause nogroup
```

After running the model, I change the values of variables to zero only adjusted for education and political interest as follows:

Code: Select all

```
sum female_c
replace female_c = 0
sum uemp_c
replace uemp_c = 0
sum yhh_c
replace yhh_c = 0
sum eisced_c
replace eisced_c = r(mean)
sum rlgdgr_c
replace rlgdgr_c = 0
sum lrscale_c
replace lrscale_c = 0
sum polintr_c
replace polintr_c = r(mean)
sum Exteff_c
replace Exteff_c = 0
bysort cntry_n:sum dependency_c
replace dependency_c = 0
bysort cntry_n:sum neet_c
replace neet_c = 0
bysort cntry_n: sum vtolder
replace vtolder = 0
```

Code: Select all

```
* Calculate the predicted probability for each young voter in the data based only on the fixed part of the model adjust education and political interest.
predict predxb
generate predprob = invlogit(predxb)
* Transform these predicted probabilities back to predicted log-odds:
generate predlogit = logit(predprob)
replace predlogit = predlogit + u0 + u1*Inteff_c
* Sort the observation for each country based on the Internal efficacy score
egen pickone = tag(cntry_n Inteff_c)
generate multiple = pickone
bysort cntry_n (Inteff_c): replace multiple = 0 if Inteff_c[_N]==Inteff_c[1]
* Plot
line predlogit Inteff_c if multiple==1, ///
connect(ascending) xtitle(Internal Efficacy) ytitle(Predicted Value)
```

Looking forward,

Regards,

Rza

PS: I was not able to attach 'dta' Stata data file. Status says 'The upload was rejected because the uploaded file was identified as a possible attack vector.'