<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>Statalist - General</title>
		<link>https://www.statalist.org/forums/</link>
		<description>Discuss Stata statistical software</description>
		<language>en</language>
		<lastBuildDate>Thu, 09 Jul 2026 08:37:47 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>images/misc/rss.png</url>
			<title>Statalist - General</title>
			<link>https://www.statalist.org/forums/</link>
		</image>
		<item>
			<title>Modeling rates of eviction</title>
			<link>https://www.statalist.org/forums/forum/general-stata-discussion/general/1786512-modeling-rates-of-eviction</link>
			<pubDate>Wed, 08 Jul 2026 21:30:48 GMT</pubDate>
			<description>Hello, I have a survey dataset with five waves. I want to estimate how baseline variables predict the number of post-baseline home evictions. I...</description>
			<content:encoded><![CDATA[Hello, I have a survey dataset with five waves. I want to estimate how baseline variables predict the number of post-baseline home evictions. I restricted the dataset to participants who were present in all five waves of the survey. Below are the frequency distributions for the number of evictions that occurred after baseline in this population.<br />
<br />
I would like to create a variable that measures the annualized incidence of home evictions. How should I calculate this variable? Once it has been created, would a Poisson regression be the appropriate model to estimate the association between the baseline predictors and the annualized incidence of evictions?<br />
<br />
<br />

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code">
 tabulation of eviction_Y1  

 Any eviction |
   in wave Y1 |      Freq.     Percent        Cum.
--------------+-----------------------------------
0.No eviction |        517       99.23       99.23
   1.Eviction |          4        0.77      100.00
--------------+-----------------------------------
        Total |        521      100.00

-&gt; tabulation of eviction_Y2  

 Any eviction |
   in wave Y2 |      Freq.     Percent        Cum.
--------------+-----------------------------------
0.No eviction |        512       99.03       99.03
   1.Eviction |          5        0.97      100.00
--------------+-----------------------------------
        Total |        517      100.00

-&gt; tabulation of eviction_Y3  

 Any eviction |
   in wave Y3 |      Freq.     Percent        Cum.
--------------+-----------------------------------
0.No eviction |        517       98.85       98.85
   1.Eviction |          6        1.15      100.00
--------------+-----------------------------------
        Total |        523      100.00

-&gt; tabulation of eviction_Y4  

 Any eviction |
   in wave Y4 |      Freq.     Percent        Cum.
--------------+-----------------------------------
0.No eviction |        516       98.66       98.66
   1.Eviction |          7        1.34      100.00
--------------+-----------------------------------
        Total |        523      100.00</pre>
</div>]]></content:encoded>
			<category domain="https://www.statalist.org/forums/forum/general-stata-discussion/general">General</category>
			<dc:creator>Luis Mijares Castaneda</dc:creator>
			<guid isPermaLink="true">https://www.statalist.org/forums/forum/general-stata-discussion/general/1786512-modeling-rates-of-eviction</guid>
		</item>
		<item>
			<title>Creating table of direct, indirect and total effects after Structural Equation Model (SEM)</title>
			<link>https://www.statalist.org/forums/forum/general-stata-discussion/general/1786505-creating-table-of-direct-indirect-and-total-effects-after-structural-equation-model-sem</link>
			<pubDate>Wed, 08 Jul 2026 11:51:19 GMT</pubDate>
			<description>Dear all, 
 
I am trying to create a table with direct, indirect and total effects after a structural equation model.  
 
After running the codes in...</description>
			<content:encoded><![CDATA[Dear all,<br />
<br />
I am trying to create a table with direct, indirect and total effects after a structural equation model. <br />
<br />
After running the codes in StataNow/SE19.5:<br />
<br />
***data from the sem documentation (example 7)<br />

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code">use https://www.stata-press.com/data/r19/sem_sm1</pre>
</div>***Example 7<br />

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code">sem (r_occasp &lt;- f_occasp r_intel r_ses f_ses) (f_occasp &lt;- r_occasp f_intel f_ses r_ses), cov(e.r_occasp*e.f_occasp) standardized</pre>
</div>***the code for decomposing total effects into direct and indirect effects<br />

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code">estat teffects</pre>
</div>the code: <br />

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code">etable</pre>
</div>will only provide the direct effects (the coefficients), and the code:<br />

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code">db tables</pre>
</div>seems to be empty.<br />
<br />
I am able to produce a table using the codes:<br />

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code">sem (r_occasp &lt;- f_occasp r_intel r_ses f_ses) (f_occasp &lt;- r_occasp f_intel f_ses r_ses), cov(e.r_occasp*e.f_occasp) standardized
estat teffects
mat direct = r(direct)'
mat indirect = r(indirect)'
mat total = r(total)'
mat rowjoin tabell = direct indirect total
mat list tabell</pre>
</div>However, I was looking for using for instance collect table and its features (e.g. list variable labels as etable does). Is there anyone out there who can help me with this? Any tip or recommendations are gratefully acknowledged.]]></content:encoded>
			<category domain="https://www.statalist.org/forums/forum/general-stata-discussion/general">General</category>
			<dc:creator>Frode Andre</dc:creator>
			<guid isPermaLink="true">https://www.statalist.org/forums/forum/general-stata-discussion/general/1786505-creating-table-of-direct-indirect-and-total-effects-after-structural-equation-model-sem</guid>
		</item>
		<item>
			<title>New Stata package available: ordaxaca (Oaxaca decomposition for ordered outcome variable)</title>
			<link>https://www.statalist.org/forums/forum/general-stata-discussion/general/1786503-new-stata-package-available-ordaxaca-oaxaca-decomposition-for-ordered-outcome-variable</link>
			<pubDate>Tue, 07 Jul 2026 19:37:10 GMT</pubDate>
			<description>Dear Statalist members, 
 
I would like to announce the availability of ordaxaca, a user-written Stata package for performing Oaxaca-style...</description>
			<content:encoded><![CDATA[Dear Statalist members,<br />
<br />
I would like to announce the availability of <b>ordaxaca</b>, a user-written Stata package for performing Oaxaca-style decomposition for ordered outcome models.<br />
<br />
The command may be useful for researchers working with ordinal dependent variables who want to decompose group differences in predicted outcomes into components associated with differences in characteristics and differences in coefficients/model structure.<br />
<br />
The package can be installed from SSC by typing: <br />
    ssc install ordaxaca <br />
After installation, the help file can be accessed by typing: <br />
    help ordaxaca <br />
I welcome any comments, bug reports, or suggestions for improvement.<br />
<br />
Best regards,<br />
Refat Mishuk<br />
 ]]></content:encoded>
			<category domain="https://www.statalist.org/forums/forum/general-stata-discussion/general">General</category>
			<dc:creator>Refat Mishuk</dc:creator>
			<guid isPermaLink="true">https://www.statalist.org/forums/forum/general-stata-discussion/general/1786503-new-stata-package-available-ordaxaca-oaxaca-decomposition-for-ordered-outcome-variable</guid>
		</item>
		<item>
			<title>Help changing data format from organisation year to country year</title>
			<link>https://www.statalist.org/forums/forum/general-stata-discussion/general/1786493-help-changing-data-format-from-organisation-year-to-country-year</link>
			<pubDate>Mon, 06 Jul 2026 12:31:42 GMT</pubDate>
			<description>Hello everyone, 
 
I have been struggling with converting my data from one format to another and I was hoping someone here would be able to at least...</description>
			<content:encoded><![CDATA[Hello everyone,<br />
<br />
I have been struggling with converting my data from one format to another and I was hoping someone here would be able to at least hint at a solution. I have tried the reshape command (to no avail) but I really don't think that it is very useful here.<br />
<br />
I have data that records yearly country membership in an international institution in the following format:<br />
<br />

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code">* Example generated by -dataex-. For more info, type help dataex
clear

input int year float ioid str11 ioname float(Afghanistan Albania Algeria Angola)
2014  24 &quot;AU&quot;      0 0 1 1
2015  24 &quot;AU&quot;      0 0 1 1
2016  24 &quot;AU&quot;      0 0 1 1
2017  24 &quot;AU&quot;      0 0 1 1
2014  26 &quot;Andean&quot;  0 0 0 0
2015  26 &quot;Andean&quot;  0 0 0 0
2016  26 &quot;Andean&quot;  0 0 0 0
2017  26 &quot;Andean&quot;  0 0 0 0
2014  17 &quot;AMU&quot;     0 0 1 0
2015  17 &quot;AMU&quot;     0 0 1 0
2016  17 &quot;AMU&quot;     0 0 1 0
2017  17 &quot;AMU&quot;     0 0 1 0
2014   2 &quot;AALCO&quot;   0 0 0 0
2015   2 &quot;AALCO&quot;   0 0 0 0
2016   2 &quot;AALCO&quot;   0 0 0 0
2017   2 &quot;AALCO&quot;   0 0 0 0
2014  23 &quot;ASEAN&quot;   0 0 0 0
2015  23 &quot;ASEAN&quot;   0 0 0 0
2016  23 &quot;ASEAN&quot;   0 0 0 0
2017  23 &quot;ASEAN&quot;   0 0 0 0
end</pre>
</div>But I need it converted to the following format:<br />
<br />
<br />

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code">* Example generated by -dataex-. For more info, type help dataex
clear
input float(ID year) str11 Country float(AU Andean AMU AALCO ASEAN)
1 2014 &quot;Afghanistan&quot; 0 0 0 0 0
1 2015 &quot;Afghanistan&quot; 0 0 0 0 0
1 2016 &quot;Afghanistan&quot; 0 0 0 0 0
1 2017 &quot;Afghanistan&quot; 0 0 0 0 0
2 2014 &quot;Albania&quot;     0 0 0 0 0
2 2015 &quot;Albania&quot;     0 0 0 0 0
2 2016 &quot;Albania&quot;     0 0 0 0 0
2 2017 &quot;Albania&quot;     0 0 0 0 0
3 2014 &quot;Algeria&quot;     1 0 1 0 0
3 2015 &quot;Algeria&quot;     1 0 1 0 0
3 2016 &quot;Algeria&quot;     1 0 1 0 0
3 2017 &quot;Algeria&quot;     1 0 1 0 0
4 2014 &quot;Angola&quot;      1 0 0 0 0
4 2015 &quot;Angola&quot;      1 0 0 0 0
4 2016 &quot;Angola&quot;      1 0 0 0 0
4 2017 &quot;Angola&quot;      1 0 0 0 0
end</pre>
</div>I would really appreciate all and any help you can give me.<br />
<br />
Best wishes,<br />
<br />
Andrea]]></content:encoded>
			<category domain="https://www.statalist.org/forums/forum/general-stata-discussion/general">General</category>
			<dc:creator>Andrea Stephenson</dc:creator>
			<guid isPermaLink="true">https://www.statalist.org/forums/forum/general-stata-discussion/general/1786493-help-changing-data-format-from-organisation-year-to-country-year</guid>
		</item>
		<item>
			<title>xtivreg FE or RE?</title>
			<link>https://www.statalist.org/forums/forum/general-stata-discussion/general/1786491-xtivreg-fe-or-re</link>
			<pubDate>Sun, 05 Jul 2026 16:30:01 GMT</pubDate>
			<description>Dear all, 
I am estimating the following models with xtivreg. I run both FE and RE. I have different nested version. I just present below the most...</description>
			<content:encoded><![CDATA[Dear all,<br />
I am estimating the following models with xtivreg. I run both FE and RE. I have different nested version. I just present below the most comprehensive specification.<br />
The Sargan-Hansen test tells me that the instruments are valid and they are in general significant in the first-stage regressions.<br />
My issue is that the coefficient associated with the variable lichag differs significantly between the FE and RE model. <br />
Could somebody clarify what is the issue? I assume that probably the idiosyncratic error term is correlated with the individual effect, and therefore the FE model should be preferred. <br />
Is that the case? How can I chose between the FE and RE specification in this case?<br />
Any help and references would be very appreciated.<br />
<br />
Below the Stata code and the results.<br />
Thanks to all for your attention<br />
Graziano<br />
<br />
<b>FE</b><br />
xtivreg lfbi lpe_g clpeg2 lcnue (licha_g licha_g2 lichaglpeg = l4.licha_g l4.licha_g2 cl4lichaglpe l5.licha_g l5.licha_g2 cl5lichaglpe), fe vce(robust) first <br />
xtoverid, robust<br />
<br />
Results of the second-stage<br />
<br />
Fixed-effects (within) IV regression            Number of obs     =        393<br />
Group variable: id                              Number of groups  =         25<br />
<br />
R-sq:                                           Obs per group:<br />
     within  =      .                                         min =          5<br />
     between = 0.2818                                         avg =       15.7<br />
     overall = 0.2107                                         max =         18<br />
<br />
<br />
                                                Wald chi2(6)      =     258.71<br />
corr(u_i, Xb)  = -0.9635                        Prob &gt; chi2       =     0.0000<br />
<br />
                                    (Std. Err. adjusted for 25 clusters in id)<br />
------------------------------------------------------------------------------<br />
             |               Robust<br />
        lfbi |      Coef.   Std. Err.      z    P&gt;|z|     [95% Conf. Interval]<br />
-------------+----------------------------------------------------------------<br />
     licha_g |  -.9405396    .237025    -3.97   0.000      -1.4051   -.4759792<br />
    licha_g2 |   .0158741    .078312     0.20   0.839    -.1376146    .1693628<br />
  lichaglpeg |  -.4737727   .1959167    -2.42   0.016    -.8577624    -.089783<br />
       lpe_g |  -.1696352    .128303    -1.32   0.186    -.4211046    .0818341<br />
      clpeg2 |  -.0756746   .0971869    -0.78   0.436    -.2661573    .1148082<br />
       lcnue |   .2535706   .0953389     2.66   0.008     .0667097    .4404315<br />
       _cons |   3.656424   .3356151    10.89   0.000      2.99863    4.314217<br />
-------------+----------------------------------------------------------------<br />
     sigma_u |  .69424319<br />
     sigma_e |  .15216016<br />
         rho |   .9541645   (fraction of variance due to u_i)<br />
------------------------------------------------------------------------------<br />
Instrumented:   licha_g licha_g2 lichaglpeg<br />
Instruments:    lpe_g clpeg2 lcnue L4.licha_g L4.licha_g2 cl4lichaglpe<br />
                L5.licha_g L5.licha_g2 cl5lichaglpe<br />
------------------------------------------------------------------------------<br />
<br />
<br />
Test of overidentifying restrictions: <br />
Cross-section time-series model: xtivreg fe  robust cluster(id)<br />
Sargan-Hansen statistic   2.700  Chi-sq(3)    P-value = 0.4403<br />
<br />
<br />
<br />
<b>RE</b><br />
xtivreg lfbi lpe_g clpeg2 lcnue (licha_g licha_g2 lichaglpeg = l4.licha_g l4.licha_g2 cl4lichaglpe l5.licha_g l5.licha_g2 cl5lichaglpe), re vce(robust) first <br />
xtoverid, robust<br />
<br />
<br />
G2SLS random-effects IV regression              Number of obs     =        393<br />
Group variable: id                              Number of groups  =         25<br />
<br />
R-sq:                                           Obs per group:<br />
     within  = 0.1248                                         min =          5<br />
     between = 0.2950                                         avg =       15.7<br />
     overall = 0.2304                                         max =         18<br />
<br />
<br />
                                                Wald chi2(6)      =      50.65<br />
corr(u_i, X)       = 0 (assumed)                Prob &gt; chi2       =     0.0000<br />
<br />
                                    (Std. Err. adjusted for 25 clusters in id)<br />
------------------------------------------------------------------------------<br />
             |               Robust<br />
        lfbi |      Coef.   Std. Err.      z    P&gt;|z|     [95% Conf. Interval]<br />
-------------+----------------------------------------------------------------<br />
     licha_g |  -.3638185   .0636239    -5.72   0.000    -.4885192   -.2391179<br />
    licha_g2 |   .0298688   .0256152     1.17   0.244    -.0203361    .0800737<br />
  lichaglpeg |  -.1218395     .09623    -1.27   0.205    -.3104468    .0667679<br />
       lpe_g |  -.1910224   .0603397    -3.17   0.002    -.3092861   -.0727587<br />
      clpeg2 |  -.1101412   .0540899    -2.04   0.042    -.2161553    -.004127<br />
       lcnue |  -.0137156   .0488238    -0.28   0.779    -.1094084    .0819773<br />
       _cons |   4.544073   .1758325    25.84   0.000     4.199447    4.888698<br />
-------------+----------------------------------------------------------------<br />
     sigma_u |  .15031847<br />
     sigma_e |  .15174156<br />
         rho |  .49528882   (fraction of variance due to u_i)<br />
------------------------------------------------------------------------------<br />
Instrumented:   licha_g licha_g2 lichaglpeg<br />
Instruments:    lpe_g clpeg2 lcnue L4.licha_g L4.licha_g2 cl4lichaglpe<br />
                L5.licha_g L5.licha_g2 cl5lichaglpe<br />
------------------------------------------------------------------------------<br />
<br />
Test of overidentifying restrictions: <br />
Cross-section time-series model: xtivreg g2sls  robust cluster(id)<br />
Sargan-Hansen statistic   5.108  Chi-sq(3)    P-value = 0.1640<br />
<br />
<br />
<br />
 ]]></content:encoded>
			<category domain="https://www.statalist.org/forums/forum/general-stata-discussion/general">General</category>
			<dc:creator>graziano ceddia</dc:creator>
			<guid isPermaLink="true">https://www.statalist.org/forums/forum/general-stata-discussion/general/1786491-xtivreg-fe-or-re</guid>
		</item>
		<item>
			<title>Ologit</title>
			<link>https://www.statalist.org/forums/forum/general-stata-discussion/general/1786480-ologit</link>
			<pubDate>Sat, 04 Jul 2026 09:55:09 GMT</pubDate>
			<description>Hello, are there any tests I have to conduct to check whether I should do an ordered logit? My dependent variable is a categorical variable (ordinal)...</description>
			<content:encoded>Hello, are there any tests I have to conduct to check whether I should do an ordered logit? My dependent variable is a categorical variable (ordinal) and my main dependent variable is binary. </content:encoded>
			<category domain="https://www.statalist.org/forums/forum/general-stata-discussion/general">General</category>
			<dc:creator>Sanjana Afroze</dc:creator>
			<guid isPermaLink="true">https://www.statalist.org/forums/forum/general-stata-discussion/general/1786480-ologit</guid>
		</item>
		<item>
			<title>endogenous vs predetermined variables in xtivreg</title>
			<link>https://www.statalist.org/forums/forum/general-stata-discussion/general/1786479-endogenous-vs-predetermined-variables-in-xtivreg</link>
			<pubDate>Sat, 04 Jul 2026 08:10:57 GMT</pubDate>
			<description>Dear Professor @Wooldridge 
I am using xtivreg to estimate a FE panel data with some endogenous independent variables. How can I determined if these...</description>
			<content:encoded><![CDATA[Dear Professor @Wooldridge<br />
I am using xtivreg to estimate a FE panel data with some endogenous independent variables. How can I determined if these variables are truly endogenous or pre-determined (in which case I could use their one-year lag as instruments)? Is there any specific test to distinguish strict endogeneity from pre-determined?<br />
At the moment I have run an Hausman test (under the assumptions that the variables are exogenous vs. non-exogenous). The result tells me that the variables are not exogenous (i.e., at best pre-determined). Yet, I would like to know whether they are pre-determined or strictly endogenous.<br />
Could anyone help?<br />
Thanks a lot for your assistance.]]></content:encoded>
			<category domain="https://www.statalist.org/forums/forum/general-stata-discussion/general">General</category>
			<dc:creator>graziano ceddia</dc:creator>
			<guid isPermaLink="true">https://www.statalist.org/forums/forum/general-stata-discussion/general/1786479-endogenous-vs-predetermined-variables-in-xtivreg</guid>
		</item>
		<item>
			<title>Creating customized -table- (or perhaps -collect combine-?-)</title>
			<link>https://www.statalist.org/forums/forum/general-stata-discussion/general/1786468-creating-customized-table-or-perhaps-collect-combine</link>
			<pubDate>Thu, 02 Jul 2026 15:11:56 GMT</pubDate>
			<description><![CDATA[I'm using Stata 18 with a large confidential admin dataset inside a Trusted Research Environment and, to get output cleared and released to the...]]></description>
			<content:encoded><![CDATA[I'm using Stata 18 with a large confidential admin dataset inside a Trusted Research Environment and, to get output cleared and released to the outside world, I need to produce spreadsheets of, on this occasion, summary statistics and the raw counts used to calculate them, I'm trying to format those statistics and counts using -table- followed by -export excel- but am unable to produce what I want. I'm also wondering whether multiple -collect- followed by a -collect combine- and then -export excel- is the way to go ... but can't see how. Here follows an example with made-up data. Think of the &quot;a_s_t&quot; variables as Actual transition probabilities between time s and time s+1, and the &quot;p_s_s+1&quot; variables as corresponding Predicted probabilities. I show you what I've produced so far, and also an example of what I'm trying to achieve. Output first (with do-file code at the end should you wish to play). Thanks for any help/suggestions!<br />
<br />
PS in my TRE dataset, there are 59 sets of transition probabilities (s = 1,...,59), and 3 types of transition probability (entry, exit, stay) with predicted and actual for each; the simplified example below has only s = 1, ..., 3), and 1 type of transition probability (actual and predicted). count(!missing(id)) is 100s of thousands of individual workers. But I figure that if the basic principles can be cracked, the code can be straightwardly scaled.<br />
<br />

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code">. cscript
-------------------------------------------------------------------------BEGIN

.
. input  id       a1_2       a2_3       a3_4       p1_2       p2_3       p3_4

            id       a1_2       a2_3       a3_4       p1_2       p2_3       p3_
&gt; 4
  1.         1   .3488717    .875991   .6950234   .7459667   .1663648   .919626
&gt; 2
  2.         2   .2668857   .2047095   .6866152   .4961259   .7437958   .693453
&gt; 3
  3.         3   .1366463   .8927587   .9319346   .7167162   .9805113   .215402
&gt; 6
  4.         4   .0285569   .5844658   .4548882    .859742   .7295772   .828588
&gt; 8
  5.         5   .8689333   .3697791   .0674011   .1340756   .9011049   .044215
&gt; 4
  6.         6   .3508549   .8506309   .3379889   .4884419   .2643649   .863037
&gt; 8
  7.         7   .0711051   .3913819   .9748848   .8712187   .8856509   .352604
&gt; 6
  8.         8    .323368   .1196613   .7264384   .7664683    .882112   .772039
&gt; 9
  9.         9   .5551032   .7542434   .0454151   .2512555    .748933   .586119
&gt; 9
 10.
. end

. * clist, noobs
.
. * format not wanted
. table (result), statistic(mean a*) statistic(count a*) ///
&gt;                                 statistic(mean p*) statistic(count p*)

----------------------------------------------------------------------------------------------
                            |      a1_2       a2_3       a3_4       p1_2       p2_3       p3_4
----------------------------+-----------------------------------------------------------------
Mean                        |  .3278139   .5604024   .5467322   .5922234   .7002683   .5861209
Number of nonmissing values |         9          9          9          9          9          9
----------------------------------------------------------------------------------------------

.
. * better, but I want 3 rows of output and 4 columns (not 6 rows and 2 cols)
. table () (result), statistic(mean a*) statistic(count a*) ///
&gt;                                 statistic(mean p*) statistic(count p*)

----------------------------------------------
     |      Mean   Number of nonmissing values
-----+----------------------------------------
a1_2 |  .3278139                             9
a2_3 |  .5604024                             9
a3_4 |  .5467322                             9
p1_2 |  .5922234                             9
p2_3 |  .7002683                             9
p3_4 |  .5861209                             9
----------------------------------------------

.
. * desired = something like the following
. /*
&gt; ----------------------------------------------------------------------------
&gt; Actual  |     Mean(a)  Count(nonmissing)   Pred    Mean(b)  Count(nonmissing)
&gt; --------+-------------------------------------------------------------------
&gt; a1_2    |  .3278139                  9       p1_2  .5922234             9
&gt; a2_3    |  .5604024                  9       p2_3  .7002683             9
&gt; a3_4    |  .5467322                  9       p3_4  .5861209             9
&gt;
&gt;
&gt; */
.
. collect clear

. table () (result), statistic(mean a*) statistic(count a*) name(c1)

----------------------------------------------
     |      Mean   Number of nonmissing values
-----+----------------------------------------
a1_2 |  .3278139                             9
a2_3 |  .5604024                             9
a3_4 |  .5467322                             9
----------------------------------------------

. table () (result), statistic(mean p*) statistic(count p*) name(c2)

----------------------------------------------
     |      Mean   Number of nonmissing values
-----+----------------------------------------
p1_2 |  .5922234                             9
p2_3 |  .7002683                             9
p3_4 |  .5861209                             9
----------------------------------------------

.
. collect combine c3 = c1 c2 // does this do horizontal concatenation?
(current collection is c3)

. collect query layout

Collection: c3
      Rows: var
   Columns: result
   Table 1: 3 x 2

. collect dims

Collection dimensions
Collection: c3
-----------------------------------------
                   Dimension   No. levels
-----------------------------------------
Layout, style, header, label
                      cmdset   1        
                  collection   2        
                     colname   6        
                     command   1        
                      result   2        
                     statcmd   2        
                         var   6        

Style only
                border_block   4        
                   cell_type   4        
-----------------------------------------

. collect levelsof result

Collection: c3
 Dimension: result
    Levels: count mean

. collect levelsof statcmd

Collection: c3
 Dimension: statcmd
    Levels: 1 2

. collect levelsof var

Collection: c3
 Dimension: var
    Levels: a1_2 p1_2 a2_3 p2_3 a3_4 p3_4

.
. * collect export table_test.xlsx, replace</pre>
</div>do-file code:<br />

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code">
cscript

input  id       a1_2       a2_3       a3_4       p1_2       p2_3       p3_4
        1   .3488717    .875991   .6950234   .7459667   .1663648   .9196262
        2   .2668857   .2047095   .6866152   .4961259   .7437958   .6934533
        3   .1366463   .8927587   .9319346   .7167162   .9805113   .2154026
        4   .0285569   .5844658   .4548882    .859742   .7295772   .8285888
        5   .8689333   .3697791   .0674011   .1340756   .9011049   .0442154
        6   .3508549   .8506309   .3379889   .4884419   .2643649   .8630378
        7   .0711051   .3913819   .9748848   .8712187   .8856509   .3526046
        8    .323368   .1196613   .7264384   .7664683    .882112   .7720399
        9   .5551032   .7542434   .0454151   .2512555    .748933   .5861199

end
* clist, noobs

* format not wanted
table (result), statistic(mean a*) statistic(count a*) ///
                statistic(mean p*) statistic(count p*)

* better, but I want 3 rows of output and 4 columns (not 6 rows and 2 cols)
table () (result), statistic(mean a*) statistic(count a*) ///
                statistic(mean p*) statistic(count p*)

* desired = something like the following
/*
----------------------------------------------------------------------------
Actual  |     Mean(a)  Count(nonmissing)   Pred       Mean(b)  Count(nonmissing)
--------+-------------------------------------------------------------------
a1_2    |  .3278139                  9       p1_2  .5922234             9
a2_3    |  .5604024                  9       p2_3  .7002683             9
a3_4    |  .5467322                  9       p3_4  .5861209             9


*/

collect clear
table () (result), statistic(mean a*) statistic(count a*) name(c1)
table () (result), statistic(mean p*) statistic(count p*) name(c2)

collect combine c3 = c1 c2 // does this do horizontal concatenation?
collect query layout
collect dims
collect levelsof result
collect levelsof statcmd
collect levelsof var

* collect export table_test.xlsx, replace</pre>
</div> ]]></content:encoded>
			<category domain="https://www.statalist.org/forums/forum/general-stata-discussion/general">General</category>
			<dc:creator>Stephen Jenkins</dc:creator>
			<guid isPermaLink="true">https://www.statalist.org/forums/forum/general-stata-discussion/general/1786468-creating-customized-table-or-perhaps-collect-combine</guid>
		</item>
		<item>
			<title>New book: MIDAS: Meta-analytical integration of diagnostic accuracy studies</title>
			<link>https://www.statalist.org/forums/forum/general-stata-discussion/general/1786460-new-book-midas-meta-analytical-integration-of-diagnostic-accuracy-studies</link>
			<pubDate>Wed, 01 Jul 2026 14:25:13 GMT</pubDate>
			<description>Subject: New book: MIDAS — Meta-Analytical Integration of Diagnostic Accuracy Studies in Stata 
 
Dear Statalisters, 
 
I am pleased to announce a...</description>
			<content:encoded><![CDATA[Subject: New book: MIDAS — Meta-Analytical Integration of Diagnostic Accuracy Studies in Stata<br />
<br />
Dear Statalisters,<br />
<br />
I am pleased to announce a new book documenting the MIDAS suite for<br />
bivariate diagnostic test accuracy (DTA) meta-analysis in Stata:<br />
<br />
MIDAS: Meta-Analytical Integration of Diagnostic Accuracy Studies<br />
Ben A. Dwamena, MD<br />
BennyBeauBooks, 2026 — 451 pages, color throughout<br />
<br />
The book covers five estimation engines side-by-side — MLE (Gaussian<br />
quadrature), QRSIM (quasi-random simulation), Metropolis-Hastings,<br />
Hamiltonian Monte Carlo via CmdStan (through my bayeshmc package),<br />
and INLA — with worked examples on real datasets in every chapter.<br />
Topics include the bivariate/HSROC model family, forest plots, SROC<br />
curves, Fagan nomograms, coupled study-weight plots, heterogeneity<br />
investigation (stratified subgroup analysis, bivariate meta-regression,<br />
area-based indices), publication bias, and clinical utility analysis<br />
using a new HSRUC decision-theoretic framework (net benefit, relative<br />
utility, standardised net benefit). Every MIDAS subcommand ships with<br />
a point-and-click GUI dialog documented in the text.<br />
<br />
Available now on Amazon in three formats:<br />
<br />
Hardback (color) ISBN 979-8-951454-80-5<br />
Paperback (color) ISBN 979-8-9951337-9-7<br />
Kindle ebook ISBN 979-8-951454-43-0<br />
<br />
<a href="https://a.co/d/04piUfzO" target="_blank">https://a.co/d/04piUfzO</a><br />
(permalink: <a href="https://www.amazon.com/dp/B0H6G4X1DW" target="_blank">https://www.amazon.com/dp/B0H6G4X1DW</a>)<br />
<br />
The MIDAS suite itself remains freely available on SSC. The current<br />
version is v3.02 (June 2026), which includes a fix to the bvsroc<br />
legend labelling and adds a previously missing internal helper — thanks<br />
to Brandon Dang for the report. To install or update:<br />
<br />
. ssc install midas, replace<br />
. ssc install midas_dlg, replace<br />
<br />
The book is intended as a working companion.<br />
<br />
Comments and errata welcome at <a href="mailto:bdwamena@umich.edu">bdwamena@umich.edu</a>.<br />
<br />
Best regards,<br />
Ben A. Dwamena, MD<br />
Clinical Associate Professor Emeritus of Radiology<br />
Division of Nuclear Medicine and Molecular Imaging<br />
University of Michigan<br />
East Lansing, Michigan]]></content:encoded>
			<category domain="https://www.statalist.org/forums/forum/general-stata-discussion/general">General</category>
			<dc:creator>Ben A. Dwamena</dc:creator>
			<guid isPermaLink="true">https://www.statalist.org/forums/forum/general-stata-discussion/general/1786460-new-book-midas-meta-analytical-integration-of-diagnostic-accuracy-studies</guid>
		</item>
		<item>
			<title>New Book on “Hamiltonian Monte Carlo in Stata” available on Amazon</title>
			<link>https://www.statalist.org/forums/forum/general-stata-discussion/general/1786459-new-book-on-“hamiltonian-monte-carlo-in-stata”-available-on-amazon</link>
			<pubDate>Wed, 01 Jul 2026 13:48:39 GMT</pubDate>
			<description>Subject: New book: Hamiltonian Monte Carlo in Stata (bayeshmc package) 
 
Dear Statalist: 
 
I am writing to let the list know about the publication...</description>
			<content:encoded><![CDATA[Subject: New book: Hamiltonian Monte Carlo in Stata (bayeshmc package)<br />
<br />
Dear Statalist:<br />
<br />
I am writing to let the list know about the publication of a new book<br />
documenting the bayeshmc Stata package:<br />
<br />
  Ben A. Dwamena (2026). Hamiltonian Monte Carlo in Stata:<br />
  Bayesian Regression Modeling with the bayeshmc Package.<br />
  BennyBeauBooks, East Lansing, Michigan. Paperback, 380 pages.<br />
  ISBN 979-8-9951337-0-4. USD 59.95.<br />
  <a href="https://a.co/d/0b2gWygH" target="_blank">https://a.co/d/0b2gWygH</a><br />
<br />
The bayeshmc package brings gradient-based Hamiltonian Monte Carlo (HMC)<br />
and the No-U-Turn Sampler (NUTS) to Stata through the Stan probabilistic-<br />
programming language via CmdStan. The estimation syntax follows Stata<br />
conventions; the underlying Stan program is generated automatically. The<br />
book documents the package and, more broadly, offers a practical<br />
reference for Bayesian regression modeling in Stata.<br />
<br />
Coverage:<br />
<br />
- Bayesian foundations and MCMC; principles of Hamiltonian dynamics and<br />
  NUTS<br />
- Prior specification, convergence diagnostics (R-hat, ESS, divergences,<br />
  tree depth), and posterior visualization<br />
- More than forty regression chapters, including linear, generalized<br />
  linear, ordinal, multinomial, censored and truncated, panel-data, and<br />
  multilevel mixed-effects models<br />
- Covariance priors for random effects; model comparison via WAIC and<br />
  PSIS-LOO<br />
- A chapter on Bayesian diagnostic test accuracy meta-analysis<br />
- Side-by-side comparison with Stata's built-in bayes: prefix<br />
  throughout, indicating when each is preferable<br />
<br />
Each chapter presents the model specification, prior recommendations, a<br />
worked example with data and code, and the auto-generated Stan program.<br />
Appendices cover installation, diagnostics, and troubleshooting.<br />
<br />
Hardcover and Kindle editions will follow in the coming weeks.<br />
<br />
Comments and corrections are welcome.<br />
<br />
Best regards,<br />
<br />
Ben A. Dwamena, MD<br />
Clinical Associate Professor Emeritus of Radiology<br />
Division of Nuclear Medicine and Molecular Imaging<br />
University of Michigan, Ann Arbor<br />
<a href="mailto:bdwamena@umich.edu">bdwamena@umich.edu</a><br />
]]></content:encoded>
			<category domain="https://www.statalist.org/forums/forum/general-stata-discussion/general">General</category>
			<dc:creator>Ben A. Dwamena</dc:creator>
			<guid isPermaLink="true">https://www.statalist.org/forums/forum/general-stata-discussion/general/1786459-new-book-on-“hamiltonian-monte-carlo-in-stata”-available-on-amazon</guid>
		</item>
		<item>
			<title>SSC Activity</title>
			<link>https://www.statalist.org/forums/forum/general-stata-discussion/general/1786457-ssc-activity</link>
			<pubDate>Wed, 01 Jul 2026 12:41:23 GMT</pubDate>
			<description>As the ssc new command shows, there were 39 packages added to the SSC Archive and 28 existing packages revised in June 2026.  Information on accesses...</description>
			<content:encoded><![CDATA[As the <span style="font-family:courier new">ssc new </span><span style="font-family:arial">command shows, there were 39 packages added to the SSC Archive and 28 existing packages revised in June 2026.  Information on accesses will be available in the next couple of days.</span>]]></content:encoded>
			<category domain="https://www.statalist.org/forums/forum/general-stata-discussion/general">General</category>
			<dc:creator>KitBaum</dc:creator>
			<guid isPermaLink="true">https://www.statalist.org/forums/forum/general-stata-discussion/general/1786457-ssc-activity</guid>
		</item>
		<item>
			<title>R(198) error while running predict after stpm3</title>
			<link>https://www.statalist.org/forums/forum/general-stata-discussion/general/1786450-r-198-error-while-running-predict-after-stpm3</link>
			<pubDate>Tue, 30 Jun 2026 18:30:28 GMT</pubDate>
			<description><![CDATA[In the attempt to learn the use of stpm3 &amp; related commands i tried to replicate the example given in the tutorial of Paul Lambert – Sofware &amp;...]]></description>
			<content:encoded><![CDATA[In the attempt to learn the use of stpm3 &amp; related commands i tried to replicate the example given in the tutorial of Paul Lambert – Sofware &amp; Tutorials site (<a href="https://pclambert.net/software.html" target="_blank">https://pclambert.net/software.html</a>) (Software&amp;Tutorials-&gt; standsurv -&gt;Standardized Relative Survival) . Running the commands I got an error (r(198)) when running predict. The error occurs because of the option frame() of the cmd predict, particularly it happens when specifying the sub option mergecreate (or create or merge or replace in successive attempts)<br />
I am using StataNow/SE 19.5 for windows, Revision 03 Jun 2026.<br />
Follow a copy of the do file commands  up until the point of error (is a copy of the command posted on the tutorial):<br />
CODE<br />
use <a href="https://www.pclambert.net/data/colonsim" target="_blank">https://www.pclambert.net/data/colonsim</a>, clear<br />
stset t, failure(dead=1,2) id(id) exit(time 5)<br />
 gen age = min(floor(agediag + _t),99)<br />
 gen year = floor(yeardiag + _t)<br />
merge m:1 age year dep sex using <a href="https://www.pclambert.net/data/popmort_uk_2017" target="_blank">https://www.pclambert.net/data/popmort_uk_2017</a>,  keep(match master) keepusing(rate)<br />
 drop age year<br />
 gen female = sex == 2<br />
stpm3 i.dep i.female i.dep#i.female @ns(agediag,df(3))  (i.dep i.female)#@ns(agediag,df(3)), scale(lncumhazard) df(5)  tvc(i.dep i.female @ns(agediag,df(3))) dftvc(3)     bhazard(rate)<br />
 foreach age in 50 65 80 {<br />
     predict S`age'_dep1 S`age'_dep5, survival timevar(0 5, step(0.1)) ci ///<br />
                                    frame(surv_age, mergecreate)        ///<br />
                                   at1(agediag `age' dep 1 female 1)       ///<br />
                                    at2(agediag `age' dep 5 female 1)               <br />
   }<br />
 CODE<br />
Since I am new to frame use I am, probably, doing a mistake. But I am not able to figure out.<br />
Thank a lot in advance for any help.<br />
Dino F Vitale]]></content:encoded>
			<category domain="https://www.statalist.org/forums/forum/general-stata-discussion/general">General</category>
			<dc:creator>Dino F Vitale</dc:creator>
			<guid isPermaLink="true">https://www.statalist.org/forums/forum/general-stata-discussion/general/1786450-r-198-error-while-running-predict-after-stpm3</guid>
		</item>
		<item>
			<title>Displaying ivqregress results</title>
			<link>https://www.statalist.org/forums/forum/general-stata-discussion/general/1786437-displaying-ivqregress-results</link>
			<pubDate>Mon, 29 Jun 2026 17:27:54 GMT</pubDate>
			<description><![CDATA[Dear All, 
I'm trying to display ivqregress results by using the suite of commands -collect-. My outcome variable is categorized BMI then I have...]]></description>
			<content:encoded><![CDATA[Dear All,<br />
I'm trying to display ivqregress results by using the suite of commands <i>-collect-. </i>My outcome variable is categorized BMI then I have three equations in the model: Overweight, Obesity and Pathologic Obesity. These models have been fitted to four surveys and I want to display results with equations in the rows and surveys in the columns. I'm using the following code:<br />
<br />
collect create iv_bmi, replace<br />
<br />
collect _r_b _r_ci, tag(model[(ENFR2005)]): ivqregress smooth imc (i.ni_cat2inv = i.ingresocat) i.age_cat5 i.sexo i.hta i.dbt if enfr==2005, quantile(52 84 95)<br />
<br />
collect _r_b _r_ci, tag(model[(ENFR2009)]): ivqregress smooth imc (i.ni_cat2inv = i.ingresocat) i.age_cat5 i.sexo i.hta i.dbt if enfr==2009, quantile(47 82 93)<br />
<br />
collect dims<br />
<br />
collect layout (coleq#colname) (results _r_b _r_ci)<br />
<br />
and the table looks like this:<br />
  <div class="text_table_"><table class="text_table"><tr valign="top" class="text_table_tr"><td class="text_table_td"></td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td"></td>
<td class="text_table_td">Coefficient</td>
<td class="text_table_td">95% CI</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td"></td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">q52</td>
<td class="text_table_td"></td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Primary/High</td>
<td class="text_table_td">School</td>
<td class="text_table_td">0.00</td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Graduated</td>
<td class="text_table_td">1.90</td>
<td class="text_table_td">1.35 2.45</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td"></td>
<td class="text_table_td">0.00</td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">30-39</td>
<td class="text_table_td">2.00</td>
<td class="text_table_td">1.84 2.16</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">40-49</td>
<td class="text_table_td">3.05</td>
<td class="text_table_td">2.87 3.23</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">50-59</td>
<td class="text_table_td">3.53</td>
<td class="text_table_td">3.33 3.73</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">60 or &gt;</td>
<td class="text_table_td">2.93</td>
<td class="text_table_td">2.71 3.14</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Male</td>
<td class="text_table_td">0.00</td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Female</td>
<td class="text_table_td">-2.13</td>
<td class="text_table_td">-2.24 -2.02</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">No</td>
<td class="text_table_td">0.00</td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Yes</td>
<td class="text_table_td">1.56</td>
<td class="text_table_td">1.38 1.74</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">No</td>
<td class="text_table_td">0.00</td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Yes</td>
<td class="text_table_td">1.19</td>
<td class="text_table_td">0.97 1.40</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Intercept</td>
<td class="text_table_td">23.18</td>
<td class="text_table_td">22.97 23.38</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">q84</td>
<td class="text_table_td"></td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Primary/High</td>
<td class="text_table_td">School</td>
<td class="text_table_td">0.00</td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Graduated</td>
<td class="text_table_td">0.28</td>
<td class="text_table_td">-0.69 1.25</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td"></td>
<td class="text_table_td">0.00</td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">30-39</td>
<td class="text_table_td">2.42</td>
<td class="text_table_td">2.17 2.68</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">40-49</td>
<td class="text_table_td">3.75</td>
<td class="text_table_td">3.45 4.04</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">50-59</td>
<td class="text_table_td">3.67</td>
<td class="text_table_td">3.32 4.02</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">60 or &gt;</td>
<td class="text_table_td">2.43</td>
<td class="text_table_td">2.08 2.77</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Male</td>
<td class="text_table_td">0.00</td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Female</td>
<td class="text_table_td">-0.99</td>
<td class="text_table_td">-1.18 -0.80</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">No</td>
<td class="text_table_td">0.00</td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Yes</td>
<td class="text_table_td">2.18</td>
<td class="text_table_td">1.89 2.48</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">No</td>
<td class="text_table_td">0.00</td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Yes</td>
<td class="text_table_td">1.96</td>
<td class="text_table_td">1.57 2.35</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Intercept</td>
<td class="text_table_td">27.41</td>
<td class="text_table_td">27.06 27.77</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">q95</td>
<td class="text_table_td"></td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Primary/High</td>
<td class="text_table_td">School</td>
<td class="text_table_td">0.00</td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Graduated</td>
<td class="text_table_td">-3.75</td>
<td class="text_table_td">-5.32 -2.17</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td"></td>
<td class="text_table_td">0.00</td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">30-39</td>
<td class="text_table_td">2.31</td>
<td class="text_table_td">1.73 2.88</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">40-49</td>
<td class="text_table_td">3.09</td>
<td class="text_table_td">2.47 3.72</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">50-59</td>
<td class="text_table_td">2.79</td>
<td class="text_table_td">2.03 3.55</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">60 or &gt;</td>
<td class="text_table_td">0.78</td>
<td class="text_table_td">0.07 1.48</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Male</td>
<td class="text_table_td">0.00</td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Female</td>
<td class="text_table_td">0.15</td>
<td class="text_table_td">-0.30 0.60</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">No</td>
<td class="text_table_td">0.00</td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Yes</td>
<td class="text_table_td">2.65</td>
<td class="text_table_td">1.97 3.33</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">No</td>
<td class="text_table_td">0.00</td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Yes</td>
<td class="text_table_td">2.99</td>
<td class="text_table_td">2.11 3.86</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Intercept</td>
<td class="text_table_td">33.25</td>
<td class="text_table_td">32.22 34.29</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">q47</td>
<td class="text_table_td"></td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Primary/High</td>
<td class="text_table_td">School</td>
<td class="text_table_td">0.00</td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Graduated</td>
<td class="text_table_td">1.74</td>
<td class="text_table_td">0.80 2.67</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td"></td>
<td class="text_table_td">0.00</td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">30-39</td>
<td class="text_table_td">1.30</td>
<td class="text_table_td">1.06 1.53</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">40-49</td>
<td class="text_table_td">1.54</td>
<td class="text_table_td">1.30 1.78</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">50-59</td>
<td class="text_table_td">1.73</td>
<td class="text_table_td">1.47 1.99</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">60 or &gt;</td>
<td class="text_table_td">1.55</td>
<td class="text_table_td">1.28 1.83</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Male</td>
<td class="text_table_td">0.00</td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Female</td>
<td class="text_table_td">-2.15</td>
<td class="text_table_td">-2.28 -2.02</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">No</td>
<td class="text_table_td">0.00</td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Yes</td>
<td class="text_table_td">2.02</td>
<td class="text_table_td">1.86 2.19</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">No</td>
<td class="text_table_td">0.00</td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Yes</td>
<td class="text_table_td">1.46</td>
<td class="text_table_td">1.21 1.71</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Intercept</td>
<td class="text_table_td">23.62</td>
<td class="text_table_td">23.22 24.02</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">q82</td>
<td class="text_table_td"></td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Primary/High</td>
<td class="text_table_td">School</td>
<td class="text_table_td">0.00</td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Graduated</td>
<td class="text_table_td">0.06</td>
<td class="text_table_td">-1.96 2.08</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td"></td>
<td class="text_table_td">0.00</td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">30-39</td>
<td class="text_table_td">1.70</td>
<td class="text_table_td">1.34 2.07</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">40-49</td>
<td class="text_table_td">2.01</td>
<td class="text_table_td">1.62 2.40</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">50-59</td>
<td class="text_table_td">2.06</td>
<td class="text_table_td">1.65 2.48</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">60 or &gt;</td>
<td class="text_table_td">1.36</td>
<td class="text_table_td">0.92 1.81</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Male</td>
<td class="text_table_td">0.00</td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Female</td>
<td class="text_table_td">-0.81</td>
<td class="text_table_td">-1.00 -0.61</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">No</td>
<td class="text_table_td">0.00</td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Yes</td>
<td class="text_table_td">2.48</td>
<td class="text_table_td">2.23 2.74</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">No</td>
<td class="text_table_td">0.00</td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Yes</td>
<td class="text_table_td">2.14</td>
<td class="text_table_td">1.81 2.47</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Intercept</td>
<td class="text_table_td">27.88</td>
<td class="text_table_td">27.12 28.63</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">q93</td>
<td class="text_table_td"></td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Primary/High</td>
<td class="text_table_td">School</td>
<td class="text_table_td">0.00</td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Graduated</td>
<td class="text_table_td">-1.89</td>
<td class="text_table_td">-3.77 -0.00</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td"></td>
<td class="text_table_td">0.00</td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">30-39</td>
<td class="text_table_td">1.55</td>
<td class="text_table_td">0.83 2.28</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">40-49</td>
<td class="text_table_td">2.19</td>
<td class="text_table_td">1.48 2.91</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">50-59</td>
<td class="text_table_td">2.17</td>
<td class="text_table_td">1.42 2.92</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">60 or &gt;</td>
<td class="text_table_td">0.93</td>
<td class="text_table_td">0.16 1.69</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Male</td>
<td class="text_table_td">0.00</td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Female</td>
<td class="text_table_td">-0.02</td>
<td class="text_table_td">-0.37 0.33</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">No</td>
<td class="text_table_td">0.00</td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Yes</td>
<td class="text_table_td">2.63</td>
<td class="text_table_td">2.21 3.04</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">No</td>
<td class="text_table_td">0.00</td>
<td class="text_table_td"></td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Yes</td>
<td class="text_table_td">2.51</td>
<td class="text_table_td">1.79 3.22</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td">Intercept</td>
<td class="text_table_td">31.67</td>
<td class="text_table_td">30.58 32.75</td>
</tr>
<tr valign="top" class="text_table_tr"><td class="text_table_td"></td>
<td class="text_table_td"></td>
</tr>
</table></div>
With the code the results are displayed one model after the other and I want one by side the other.<br />
Can someone help me?<br />
Thank you in advance<br />
 ]]></content:encoded>
			<category domain="https://www.statalist.org/forums/forum/general-stata-discussion/general">General</category>
			<dc:creator>Alberto Ruben Osella</dc:creator>
			<guid isPermaLink="true">https://www.statalist.org/forums/forum/general-stata-discussion/general/1786437-displaying-ivqregress-results</guid>
		</item>
		<item>
			<title>faSTM: A Stata package for Structural Topic Models</title>
			<link>https://www.statalist.org/forums/forum/general-stata-discussion/general/1786435-fastm-a-stata-package-for-structural-topic-models</link>
			<pubDate>Mon, 29 Jun 2026 16:47:24 GMT</pubDate>
			<description>Dear Statalist users, 
 
I would like to announce fastm, a new Stata package for fitting Structural Topic Models (STM). 
 
fastm is a Stata port of...</description>
			<content:encoded><![CDATA[Dear Statalist users,<br />
<br />
I would like to announce <b>fastm</b>, a new Stata package for fitting <b>Structural Topic Models</b> (STM).<br />
<br />
fastm is a Stata port of the R package <a href="https://www.structuraltopicmodel.com/" target="_blank">stm</a> (Roberts, Stewart, and Tingley 2019). It fits the same model, one in which document-level covariates can shape both how <i>prevalent</i> a topic is and how its <i>words</i> are chosen, and it reproduces stm's results to within 0.001% on the poliblog corpus. Fitting, tokenization, FREX labeling, diagnostics, and covariate-effect estimation all run in a compiled Rust plugin, so no Python and no Rust toolchain are needed to use it,<br />
<br />
To install, type:<br />
<br />

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code">net install fastm, from(&quot;https://raw.githubusercontent.com/nealcaren/faSTM-stata/main/ado/&quot;) replace</pre>
</div>Requires Stata 15 or later. The macOS plugin is a universal binary (Intel and Apple Silicon); the Linux and Windows plugins are x86_64.<br />
<br />
Key features of fastm include:<ul><li>Fit an STM directly from a Stata string variable (one document per observation); honors if/in.</li>
<li>Transparent preprocessing controls: stopwords, minimum document frequency, maximum document percentage, lowercasing (stm's prepDocuments).</li>
<li>Prevalence covariates with full factor-variable syntax: i.party, c.year, interactions i.party##c.year, and smooth spline() terms (stm's s()).</li>
<li>Content covariates via the SAGE content model, shifting topic-word distributions across groups.</li>
<li>Topic labels and diagnostics: FREX / probability / lift / score, semantic coherence, and exclusivity, computed stm-faithfully in the engine.</li>
<li><b>estimateEffect</b>: covariate effects on topic prevalence, estimated by the method of composition with standard errors that propagate per-document topic-estimation uncertainty, posted as e(b)/e(V) so that test, lincom, margins, and marginsplot all work.</li>
<li>predict (xtreg-style) for prevalence-fitted topic proportions, and searchk to choose K by held-out document completion.</li>
</ul><br />
The example below fits a 20-topic model on Roberts et al.'s political-blog corpus (5,000 posts from the 2008 U.S. campaign), loaded straight from the web:<br />
<br />

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code">. use &quot;https://raw.githubusercontent.com/nealcaren/faSTM-stata/main/data/poliblog.dta&quot;, clear

. fastm text, k(20) prevalence(i.liberal) seed(2138)
fastm: corpus = 5000 docs, 2632 terms, 1005745 tokens; fitting K=20 ...
fastm: prep = lowercase on, mindocfreq 1, maxdocpct 100%, stopwords none
fastm: prevalence design = intercept + 1 covariate(s)
fastm: top FREX words per topic [coherence / exclusivity] --
  topic  2 [coh  -51.83, excl   9.80]: parti republican democrat conserv pelosi gop nomine elect
  topic  6 [coh  -81.06, excl   9.79]: wright barack ayer obama black chicago jeremiah racist
  topic  8 [coh  -81.51, excl   9.75]: israel isra iran hama iranian terrorist islam bomb
  topic 10 [coh  -68.10, excl   9.73]: energi oil economi tax price health drill job
  topic 15 [coh  -73.33, excl   9.73]: palin mccain sarah romney john alaska giuliani governor
  (... 15 more topics ...)
fastm: estimateEffect done (1 term(s), 100 draws, method of composition)
fastm: done. bound=-6943448.29, iters=24, mean coherence=-68.71, mean exclusivity=9.67

Structural Topic Model                         Documents      =     5,000
Engine: topica-core (Rust)                     Vocabulary     =     2,632
                                               Topics (K)     =        20
                                               Prevalence     =         1 term(s)
                                               Final bound    = -6.94e+06
Mean semantic coherence  =    -68.71           Mean exclusivity =      9.67
Topic proportions in theta1-theta20 (EM iters        24)

Covariate effects on topic proportions (method of composition)
------------------------------------------------------------------------------
             |      Coef.   Std. Err.      z    P&gt;|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  (equations topic1-topic20; topic 8 = Israel / Iran / terrorism shown)
topic8       |
       _cons |   .0571003    .001919    29.75   0.000     .0533391    .0608616
             |
     liberal |
    Liberal  |  -.0341273   .0028891   -11.81   0.000    -.0397898   -.0284648
------------------------------------------------------------------------------</pre>
</div>Because fastm posts e(b)/e(V) with one equation per topic, the usual Stata postestimation machinery works on topic prevalence. For the Israel/Iran topic (topic 8), we can test whether liberal and conservative blogs differ, and plot the predicted prevalence:<br />
<br />

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code">. test [topic8]1.liberal

 ( 1)  [topic8]1.liberal = 0

           chi2(  1) =  139.53
         Prob &gt; chi2 =    0.0000

. margins liberal, predict(equation(topic8))

Adjusted predictions                            Number of obs     =      5,000
Expression   : Linear prediction, predict(equation(topic8))

-------------------------------------------------------------------------------
              |            Delta-method
              |     Margin   Std. Err.      z    P&gt;|z|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
      liberal |
Conservative  |   .0571003    .001919    29.75   0.000     .0533391    .0608616
     Liberal  |    .022973   .0021606    10.63   0.000     .0187383    .0272078
-------------------------------------------------------------------------------

. marginsplot</pre>
</div><b>Looking for Windows beta testers.</b> I have validated the package on macOS and Linux, and the Windows plugin is built and smoke-tested in CI, but I would like confirmation that it loads and runs correctly on a real Windows copy of Stata before a 1.0 release. If you run Stata on Windows and are willing to try the install above and report back, I would be grateful. A quick &quot;it worked,&quot; or a copy of any error message, is exactly what I need.<br />
<br />
Comments, suggestions, and bug reports are welcome.<br />
<br />
Reference:<br />
<br />
Roberts, M. E., Stewart, B. M., and Tingley, D. 2019. stm: An R package for structural topic models. Journal of Statistical Software 91(2): 1-40. <a href="https://doi.org/10.18637/jss.v091.i02" target="_blank">https://doi.org/10.18637/jss.v091.i02</a>.<br />
<br />
Neal Caren<br />
]]></content:encoded>
			<category domain="https://www.statalist.org/forums/forum/general-stata-discussion/general">General</category>
			<dc:creator>Neal Caren</dc:creator>
			<guid isPermaLink="true">https://www.statalist.org/forums/forum/general-stata-discussion/general/1786435-fastm-a-stata-package-for-structural-topic-models</guid>
		</item>
		<item>
			<title>Multilevel Poisson</title>
			<link>https://www.statalist.org/forums/forum/general-stata-discussion/general/1786432-multilevel-poisson</link>
			<pubDate>Mon, 29 Jun 2026 14:04:04 GMT</pubDate>
			<description>I am working on multilevel Poisson. I faced a problem with the svy command when I ran mepoisson. As I am working with the DHS dataset. I have...</description>
			<content:encoded><![CDATA[I am working on multilevel Poisson. I faced a problem with the svy command when I ran mepoisson. As I am working with the DHS dataset. I have calculated level-1 and level-2 weights according to the DHS report 27. Thereafter, I ran the mepisson command. But mepisson does not support svy. I have also followed the Stata manual for multilevel Poisson modelling to create the command mentioned below. If anyone could, please help me in this matter. Is my mepoison command correct?<br />
<br />
<br />
* Create a constant cluster-level weight<br />
bysort v001: egen wt2_05_constant = mean(wt2_05)<br />
<br />
mepoisson children_born i.dv_any_violence i.region v012 i.education  i.residence   ///<br />
  lom_prof_community  ///<br />
      [pweight=wt1_05] || v001:, pweight(wt2_05_constant) irr vce(robust)    ]]></content:encoded>
			<category domain="https://www.statalist.org/forums/forum/general-stata-discussion/general">General</category>
			<dc:creator>Khawar Afreen</dc:creator>
			<guid isPermaLink="true">https://www.statalist.org/forums/forum/general-stata-discussion/general/1786432-multilevel-poisson</guid>
		</item>
	</channel>
</rss>
