<?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 - Forums</title>
		<link>https://www.statalist.org/forums/</link>
		<description>vBulletin Forums</description>
		<language>en</language>
		<lastBuildDate>Mon, 23 Nov 2026 13:29:33 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>images/misc/rss.png</url>
			<title>Statalist - Forums</title>
			<link>https://www.statalist.org/forums/</link>
		</image>
		<item>
			<title>Dot charts on log scales</title>
			<link>https://www.statalist.org/forums/forum/general-stata-discussion/general/1788242-dot-charts-on-log-scales</link>
			<pubDate>Thu, 19 Nov 2026 14:42:52 GMT</pubDate>
			<description>This thread is forked from Break in both x and y axis - Statalist...</description>
			<content:encoded><![CDATA[This thread is forked from <a href="https://www.statalist.org/forums/forum/general-stata-discussion/general/1731462-break-in-both-x-and-y-axis" target="_blank">Break in both x and y axis - Statalist</a> because it is a digression from the topic indicated by the title and because I have what is to me a different positive message.<br />
<br />
I hope that everyone interested can agree that<br />
<br />
* Some people want to publish graphs with breaks on one or even two axes.<br />
<br />
* Stata doesn't support scale breaks directly: you need to use other devices to implement scale breaks.<br />
<br />
<a href="https://www.stata.com/support/faqs/graphics/scale-breaks/" target="_blank">Stata | FAQ: Showing scale breaks on graphs</a> stands as evidence that I agree that occasionally a scale break makes sense.<br />
<br />
Where there is scope to disagree is over how often logarithmic (or other nonlinear) scales are a better idea.<br />
<br />
<a href="https://www.statalist.org/forums/member/19647-john-mullahy" class="b-bbcode-user js-bbcode-user" data-userid="19647">John Mullahy</a> revived that thread on breaks in axes by posting a graphic with one very long bar twisted into a long snake. One merit of his example (among several) is that the data can easily be read off the graph to allow experiment with other possibilities.<br />
<br />
So snakes or even spirals are another solution. Recently there has been renewed interest in the graphical work of W.E. Du Bois, who used them often, but similar ideas have a long history.<br />
<br />
The context of Du Bois was very much one of outreach, of graphics intended to be read as well by people with limited schooling and without much experience or expertise in interpreting graphics. That makes sense of not using logarithms for his purposes. To be clear, I have no information on whether Du Bois knew about logarithmic scales, let alone about whether they were considered. They were introduced several decades earlier.<br />
<br />
But that context is not necessarily ours. If your concern is with graphics for any very wide readership, it is always vital to think about what people will understand. My concern is usually with graphics aimed at colleagues in the widest sense, including students and fellow researchers. For this group, my attitude is paternalistic: if you don't understand or feel uncomfortable with logarithmic scales, what you most need is a little explanation and a lot of examples so that in due course they do become familiar. As I have mentioned elsewhere, I was struck during the Covid pandemic of how better newspapers and television channels immediately started using logarithmic scales for graphics without fuss or fanfare, as no other scales made sense for many of the data.<br />
<br />
Enough preamble. First come some code and then the resulting graphs using logarithmic scales and a commentary. Some of the commentary will seem too obvious to some readers to be spelled out, but no apologies otherwise.<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 str13 country float production
&quot;China&quot;          209
&quot;Thailand&quot;        22
&quot;India&quot;         12.5
&quot;Brazil&quot;         6.4
&quot;Malaysia&quot;         6
&quot;Japan&quot;            5
&quot;United States&quot;  4.1
&quot;Mexico&quot;         3.5
&quot;South Korea&quot;    2.5
&quot;Turkey&quot;         2.2
end

gen log_production = ln(production)

* search gr0092, entry
mylabels 2 5 10 20 50 100 200, myscale(ln(@)) local(labels)

graph dot (asis) log_production, over(country, sort(1) descending) exclude0 ///
yla(`labels') ysc(alt) ytitle(Air conditioner production 2025 (millions))   ///
linetype(line) lines(lw(vthin) lc(gs12)) name(logdot1, replace)

gen order = _n

* search gr0034, entry
labmask order, values(country)

scatter order log_production, ///
ytitle(&quot;&quot;) ysc(r(0.8 10.2) reverse) yla(1/10, noticks valuelabel glp(solid)) ///
mla(production) mlabsize(medium) xsc(alt range(. `=ln(240)')) ///
xlabels(`labels', nogrid) xtitle(Air conditioner production 2025 (millions)) ///
name(logdot2, replace)

scatter order production, ///
ytitle(&quot;&quot;) ysc(r(0.8 10.2) reverse) yla(1/10, noticks valuelabel glp(solid)) ///
mla(production) mlabsize(medium) xsc(log) xsc(alt range(. 240)) ///
xlabels(2 5 10 20 50 100 200, nogrid) xtitle(Air conditioner production 2025 (millions)) ///
name(logdot3, replace)</pre>
</div>  <a href="filedata/fetch?filedataid=1788243">Array </a><br />
 <br />
<br />
If you think that the data will go fine as a table, that is a perfectly defensible point of view, and you probably bailed out long before reading this.<br />
<br />
If you think that the original scale is fine -- it just implies one very long bar on a bar chart and all the others short -- that is a defensible point of view too, especially if the intent is to ram home a message that China dwarfs all other countries in this market.<br />
<br />
All the graphs here echo the design in the original graphic, as cited by John, that horizontal layout is preferable to show text labels -- the country names -- legibly. All too often vertical layout obliges awkward solutions -- tiny font sizes, abbreviations, text on a slope -- that shouldn't be willingly indulged.<br />
<br />
Now<span style="font-family:courier new"> graph dot </span>as I understand it allows<span style="font-family:courier new"> yscale(log) </span>as an option but I never, or almost never, get good results with that. The work-around is to calculate logarithms and then use a helper command to show axis labels that use the original units. The code flags that<br />
<br />

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code">search gr0092, entry</pre>
</div>-- currently commented out -- should be issued as a command to find the latest download location for <span style="font-family:courier new">mylabels </span><span style="font-family:arial">if you have not previously installed it.<br />
<br />
Having seen that the values range from about 2 million to about 200 million it seemed natural to base the labels to be shown on a logarithmic scale on a standard pattern which can be denoted 125. For much more discussion of related issues see </span><a href="https://journals.sagepub.com/doi/pdf/10.1177/1536867X1801800116" target="_blank">Speaking Stata: Logarithmic Binning and Labeling</a>. I both claim that this is the most thorough discussion anywhere that I know and admit that many smart first-year undergraduates (say) are capable of thinking through such small issues by themselves. Either way a simple but fundamental point: choosing a logarithmic scale but showing logarithms as axis labels only goes part way to explaining what is being shown. (Occasionally showing integer powers of 10 as such is the only way to avoid absurd numbers of zeros.)<br />
<br />
A detail: I have found that the default dotted line grid degrades if the graph is ported to some other software. On that ground, and otherwise, I commend thin grey lines as grid for which<br />
<br />

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code">linetype(line) lines(lw(vthin) lc(gs12))</pre>
</div>is an incantation to be varied according to taste. <a href="filedata/fetch?filedataid=1788244">Array </a><br />
 <br />
<br />
The second graph switches to<span style="font-family:courier new"> twoway scatter </span>-- which compared with <span style="font-family:courier new">graph dot</span> makes some things easier, but obliges a few fairly simple tricks. We need a vertical axis which in the first instance is just the order of observations, as the data arrive sorted. (In some other problems, you will need to sort first.) The order of observations for this dataset is just the integers 1 to 10, but we really need the country names to be shown. Rather than typing out those names explicitly, a helper command<span style="font-family:courier new"> labmask</span> copies the values of a string variable containing the country names to be the value labels of the new numeric variable. The command is more versatile than for that single task.<br />
<br />
Again the code<br />
<br />

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code">search gr0034, entry</pre>
</div>gives the latest download location for <span style="font-family:courier new">labmask</span> (detail: if you want to cite this command, please cite it as published in the<i> Stata Journal</i>). I prefer to suppress axis ticks whenever one axis is essentially categorical, not numeric. A positive possibility with using <span style="font-family:courier new">scatter </span>is that marker labels can be added easily. We just need -- at least with the default marker label position of 3 pm on a clock scale to add a little extra space to accommodate the largest marker label, 209 for China. As we're using logarithmic scale, the code<br />
<br />

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code">`= ln(240)'</pre>
</div>says to Stata: calculate the value of<span style="font-family:courier new"> ln(240) </span>and use the result immediately at this point.<br />
<br />
  <a href="filedata/fetch?filedataid=1788245">Array </a><br />
 <br />
<br />
<br />
<br />
<br />
The third graph shows that we could get there more directly by using the original data and leaning on<span style="font-family:courier new"> xsc(log)</span>. <span style="font-family:arial">If you reached that conclusion immediately, that's excellent.<br />
<br />
Both the last two graphs add a little space above the first and below the last row: see how the scale goes from 0.8 to 10.2, not 1 to 10.<br />
<br />
More obviously, all these graphs build in a personal bias, although you may be persuaded too, that whenever graphs have something of table flavour, it is natural, or at least congenial, not only to place an axis title at the top, but also the numeric axis itself. A riff on this point can be found at </span><a href="https://journals.sagepub.com/doi/pdf/10.1177/1536867X1201200314" target="_blank">Speaking Stata: Axis Practice, or What Goes Where on a Graph</a>.<span style="font-family:arial"> (Although I haven't done it here, that leaves more space if needed to specify at the bottom of the graph the data source and/or add any notes that seem essential.) </span><br />
<br />
 ]]></content:encoded>
			<category domain="https://www.statalist.org/forums/forum/general-stata-discussion/general">General</category>
			<dc:creator>Nick Cox</dc:creator>
			<guid isPermaLink="true">https://www.statalist.org/forums/forum/general-stata-discussion/general/1788242-dot-charts-on-log-scales</guid>
		</item>
		<item>
			<title>Which AI LLM is suitable to Stata?</title>
			<link>https://www.statalist.org/forums/forum/general-stata-discussion/general/1788225-which-ai-llm-is-suitable-to-stata</link>
			<pubDate>Wed, 18 Nov 2026 15:18:13 GMT</pubDate>
			<description>cited: Letting AI agents write econometric code (https://cepr.org/voxeu/columns/letting-ai-agents-write-econometric-code) 
 
eric_a_booth wrote...</description>
			<content:encoded><![CDATA[<div class="bbcode_container">
	<div class="bbcode_quote">
		<div class="quote_container">
			<div class="bbcode_quote_container vb-icon vb-icon-quote-large"></div>
			
				Under the chatbot with no example, Stata trails Python by 25.5 percentage points for Claude Sonnet 4.6 and by 30.8 points for GPT-5.6 Luna. Yet Stata is the most widely used software in empirical economics (Vilhuber et al. 2020). Under the agent with no example, the gap falls to 1.3 points for Claude Sonnet 4.6 and 6.8 points for GPT-5.6 Luna.
			
		</div>
	</div>
</div> cited: <a href="https://cepr.org/voxeu/columns/letting-ai-agents-write-econometric-code" target="_blank">Letting AI agents write econometric code</a><br />
<br />
<a href="https://www.statalist.org/forums/member/401-eric_a_booth" class="b-bbcode-user js-bbcode-user" data-userid="401">eric_a_booth</a> wrote gemini.ado which use Gemini AI directly from the Stata command line to support research, coding, and data tasks. For some reasons, gemini is prohibited here. My questions are: (1) specifically, is there any similar package as Booth's gemini in Stata? and (2) generally, which AI is most suitable to Stata as yet?<br />

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code">. gemini &quot;tells me story about auto dataset shipping with Stata&quot;
gemini v2.3.4
Consulting Gemini CLI...
Command: gemini --yolo -p ...
Error: Shell failed to create output file.
r(601);</pre>
</div>]]></content:encoded>
			<category domain="https://www.statalist.org/forums/forum/general-stata-discussion/general">General</category>
			<dc:creator>Chen Samulsion</dc:creator>
			<guid isPermaLink="true">https://www.statalist.org/forums/forum/general-stata-discussion/general/1788225-which-ai-llm-is-suitable-to-stata</guid>
		</item>
		<item>
			<title>Loneway for reliability</title>
			<link>https://www.statalist.org/forums/forum/general-stata-discussion/general/1788203-loneway-for-reliability</link>
			<pubDate>Tue, 17 Nov 2026 23:05:47 GMT</pubDate>
			<description><![CDATA[loneway calculates &quot;reliability&quot; calculated at a value of n per group.  In this example, there are 496 ratings (PIP Total) from 57 groups (znum) or...]]></description>
			<content:encoded><![CDATA[loneway calculates &quot;reliability&quot; calculated at a value of n per group.  In this example, there are 496 ratings (PIP Total) from 57 groups (znum) or 8.7 ratings per group. Why does the output  say &quot;evaluated at n=8.35&quot;?<br />
<br />
Many thanks,<br />
<br />
Ben<br />
<br />

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code">             One-way analysis of variance for pip_score: PIP Total

                                             Number of obs =          496
                                                 R-squared =       0.2738

    Source                SS         df      MS            F     Prob &gt; F
-------------------------------------------------------------------------
Between znum           40321.257     56    720.02245      2.96     0.0000
Within znum            106959.69    439    243.64395
-------------------------------------------------------------------------
Total                  147280.95    495    297.53727

         Intraclass       Asy.        
         correlation      S.E.       [95% conf. interval]
         ------------------------------------------------
            0.18971     0.06230       0.06761     0.31181

         Estimated SD of znum effect             7.552705
         Estimated SD within znum                 15.6091
         Est. reliability of a znum mean          0.66162
              (evaluated at n=8.35)</pre>
</div>]]></content:encoded>
			<category domain="https://www.statalist.org/forums/forum/general-stata-discussion/general">General</category>
			<dc:creator>Ben Littenberg</dc:creator>
			<guid isPermaLink="true">https://www.statalist.org/forums/forum/general-stata-discussion/general/1788203-loneway-for-reliability</guid>
		</item>
		<item>
			<title>A note on anovaplot (and anova)</title>
			<link>https://www.statalist.org/forums/forum/general-stata-discussion/general/1788189-a-note-on-anovaplot-and-anova</link>
			<pubDate>Tue, 17 Nov 2026 15:19:21 GMT</pubDate>
			<description><![CDATA[The last version of Nick Cox's -anovaplot- command dates back to 2004. With the introduction of factor notation in Stata 11 (July 2009) and changes...]]></description>
			<content:encoded><![CDATA[The last version of <a href="https://www.statalist.org/forums/member/6-nick-cox" class="b-bbcode-user js-bbcode-user" data-userid="6">Nick Cox</a>'s <span style="font-family:courier new">-anovaplot-</span> command dates back to 2004. With the introduction of factor notation in Stata 11 (July 2009) and changes to the <b>anova</b> syntax, some examples in the anovaplot help file require version control or appropriate modification; otherwise the graphs it generates may be misleading.<br />
In Stata 11 and newer versions, the options category(), class(), and continuous() are no longer used in anova command, and you should <a href="https://www.stata.com/stata11/mvmethods.html" target="_blank">use <b>c.</b><i>varname</i> to indicate continuous</a>. Check the difference:<br />

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code">sysuse auto
decode foreign, gen(Foreign)
gen F = substr(Foreign,1,1)

version 10: anova price weight foreign, <span style="color:#FF0000">cont(weight)</span>
anovaplot, scatter(ms(i) mla(F) mlabpos(0))

version 11: anova price <span style="color:#FF0000">c.weight</span> foreign
anovaplot, scatter(ms(i) mla(F) mlabpos(0))

version 11: anova price <span style="color:#FF0000">weight</span> foreign
anovaplot, scatter(ms(i) mla(F) mlabpos(0))</pre>
</div>]]></content:encoded>
			<category domain="https://www.statalist.org/forums/forum/general-stata-discussion/general">General</category>
			<dc:creator>Chen Samulsion</dc:creator>
			<guid isPermaLink="true">https://www.statalist.org/forums/forum/general-stata-discussion/general/1788189-a-note-on-anovaplot-and-anova</guid>
		</item>
		<item>
			<title>SSC Archive durability</title>
			<link>https://www.statalist.org/forums/forum/general-stata-discussion/general/1788167-ssc-archive-durability</link>
			<pubDate>Mon, 16 Nov 2026 13:47:21 GMT</pubDate>
			<description>In a post on 10-Nov-2026 Chen Samulsion (https://www.statalist.org/forums/member/26794-chen-samulsion) questioned the future stability of the SSC...</description>
			<content:encoded><![CDATA[In a post on 10-Nov-2026 <a href="https://www.statalist.org/forums/member/26794-chen-samulsion" target="_blank">Chen Samulsion</a> questioned the future stability of the SSC Archive.  As I announced at the UK Stata Conference 2026 and US Stata Conference 2026, there is an ongoing process, with external funding, to support the evolution of the SSC Archive. Please see <a href="https://ssc-ng.net" target="_blank">https://ssc-ng.net</a> and <a href="https://econpapers.repec.org/paper/bocusug26/22.htm" target="_blank">https://econpapers.repec.org/paper/bocusug26/22.htm</a>]]></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/1788167-ssc-archive-durability</guid>
		</item>
		<item>
			<title>json file</title>
			<link>https://www.statalist.org/forums/forum/general-stata-discussion/general/1788150-json-file</link>
			<pubDate>Sun, 15 Nov 2026 18:26:30 GMT</pubDate>
			<description><![CDATA[I am trying to import a file to Stata but can't get it work.  I have the  and the file is:  
snd0007-1-1.0-json-ld.json 
Help on how to do this would...]]></description>
			<content:encoded><![CDATA[I am trying to import a file to Stata but can't get it work.  I have the  and the file is: <br />
snd0007-1-1.0-json-ld.json<br />
Help on how to do this would be appreciated]]></content:encoded>
			<category domain="https://www.statalist.org/forums/forum/general-stata-discussion/general">General</category>
			<dc:creator>Euslaner</dc:creator>
			<guid isPermaLink="true">https://www.statalist.org/forums/forum/general-stata-discussion/general/1788150-json-file</guid>
		</item>
		<item>
			<title>clustered heatmap in Stata</title>
			<link>https://www.statalist.org/forums/forum/general-stata-discussion/general/1788100-clustered-heatmap-in-stata</link>
			<pubDate>Sat, 14 Nov 2026 12:18:21 GMT</pubDate>
			<description><![CDATA[Many children, when they see something they like, will wave their little hands at their mom and dad and say, &quot;I want it, I want it.&quot; Just like those...]]></description>
			<content:encoded><![CDATA[Many children, when they see something they like, will wave their little hands at their mom and dad and say, &quot;I want it, I want it.&quot; Just like those children, when I see some statistical graphs in R or Python, I will also use my hands to search or help at Stata command window, saying to Stata, &quot;I want it, I want it.&quot; Today, while looking at the correlation matrix produced by <span style="font-family:courier new">-tetrachoric-</span> and the <span style="font-family:courier new">-heatplot-</span> command written by <a href="https://www.statalist.org/forums/member/3916-ben-jann" class="b-bbcode-user js-bbcode-user" data-userid="3916">Ben Jann</a>, I was wondering: do we have—or could we have—something like<span style="color:#FF0000"> <b>pheatplot</b></span> from R? pheatplot is clustered heatmaps; of course, the &quot;p&quot; in its name stands for &quot;pretty&quot;—the author considers it a pretty heatmap, and indeed it lives up to the name.<br />
<br />
<a href="https://pheatmap.com/" target="_blank">Pheatmap: Beautiful heatmaps, written in one line of R.</a><br />
<br />
<a href="https://r-charts.com/correlation/pheatmap/" target="_blank">pheatmap function in R</a><br />
<br />
<a href="https://www.statalist.org/forums/forum/general-stata-discussion/general/1772624-a-little-help-with-heatmap-and-commands-related" target="_blank">A little help with Heatmap and commands related</a><br />
  <a href="filedata/fetch?filedataid=1788101">Array </a><br />
]]></content:encoded>
			<category domain="https://www.statalist.org/forums/forum/general-stata-discussion/general">General</category>
			<dc:creator>Chen Samulsion</dc:creator>
			<guid isPermaLink="true">https://www.statalist.org/forums/forum/general-stata-discussion/general/1788100-clustered-heatmap-in-stata</guid>
		</item>
		<item>
			<title>File not saving</title>
			<link>https://www.statalist.org/forums/forum/general-stata-discussion/general/1788088-file-not-saving</link>
			<pubDate>Fri, 13 Nov 2026 13:49:01 GMT</pubDate>
			<description><![CDATA[I'm attempting to export a file to Excel and I keep getting error 603 despite changing the permissions of the folder and the name of the file. It...]]></description>
			<content:encoded><![CDATA[I'm attempting to export a file to Excel and I keep getting error 603 despite changing the permissions of the folder and the name of the file. It just tells me it 'could not be saved', anyone have any ideas why this may be the case?]]></content:encoded>
			<category domain="https://www.statalist.org/forums/forum/general-stata-discussion/general">General</category>
			<dc:creator>Maddi Ball</dc:creator>
			<guid isPermaLink="true">https://www.statalist.org/forums/forum/general-stata-discussion/general/1788088-file-not-saving</guid>
		</item>
		<item>
			<title>CSDID with cross-sectional data and multicolinearity</title>
			<link>https://www.statalist.org/forums/forum/general-stata-discussion/general/1788080-csdid-with-cross-sectional-data-and-multicolinearity</link>
			<pubDate>Thu, 12 Nov 2026 19:33:20 GMT</pubDate>
			<description>Hello everyone (@FernandoRios), 
 
I am using StataNow 19.5 (SE – Standard Edition) and would appreciate some guidance on how csdid handles...</description>
			<content:encoded><![CDATA[Hello everyone (@FernandoRios),<br />
<br />
I am using StataNow 19.5 (SE – Standard Edition) and would appreciate some guidance on how csdid handles covariates in a setting like mine.<br />
<br />
My dataset is cross-sectional, with approximately 13,000 observations. Each observation corresponds to one individual, and I observe their outcome in one of several survey years.<br />
<br />
My treatment is assigned at the cohort level, based on the year individuals entered school. I therefore use school-entry year as the time variable and the treatment cohort variable to identify when each cohort became exposed to the policy. The policy was adopted at different times across states (staggered adoption).<br />
<br />
My specifications are:<br />
<br />
<b>TWFE:</b><br />

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code">reghdfe outcome treatment female age age2, absorb(state school_entry_year survey_year) cluster(state_school_entry_year)</pre>
</div><b>CSDID</b> (version v1.8 br FRA. and v1.81 by Pedro Sant'Anna)<b>:</b><br />

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code">csdid outcome female age age2 survey_year_dummies, time(school_entry_year) gvar(treatment_year) cluster(state_school_entry_year) agg(simple)</pre>
</div>The variables are defined as follows:<br />
- Age: Age at the time the outcome is measured, calculated as survey year minus birth year.<br />
- Survey year: The year in which the outcome is measured.<br />
- School-entry year: Birth year + 6.<br />
- Treatment: A dummy indicating whether the individual is exposed to the policy.<br />
<br />
My question is: <b>How does </b><b>csdid</b><b> handle multicollinearity among covariates?</b><br />
This is particularly relevant in my setting because age is mechanically determined by the survey year and school-entry year:<br />
Age = Survey year − School-entry year + 6.<br />
Therefore, age is perfectly collinear with the survey-year and school-entry-year fixed effects in the TWFE specification, and it is automatically dropped from the regression. However, when I include age as a covariate in <b>csdid</b>, the estimate changes: its magnitude decreases and it becomes statistically insignificant. Why does csdid not seem to drop age in the same way as TWFE? How does the estimator handle this relationship when incorporating covariates into the 2×2 comparisons?<br />
<br />
Why does csdid not seem to drop age in the same way as TWFE? Is this because the estimator handles covariates differently when constructing the 2×2 comparisons? More generally, how does <b>csdid</b> handle this?<br />
<br />
Thank you very much!]]></content:encoded>
			<category domain="https://www.statalist.org/forums/forum/general-stata-discussion/general">General</category>
			<dc:creator>Ayisha Awol</dc:creator>
			<guid isPermaLink="true">https://www.statalist.org/forums/forum/general-stata-discussion/general/1788080-csdid-with-cross-sectional-data-and-multicolinearity</guid>
		</item>
		<item>
			<title>command multivariate linear regression for sample size of categories in categorical variable when cases dropped due to missing data</title>
			<link>https://www.statalist.org/forums/forum/general-stata-discussion/general/1788067-command-multivariate-linear-regression-for-sample-size-of-categories-in-categorical-variable-when-cases-dropped-due-to-missing-data</link>
			<pubDate>Wed, 11 Nov 2026 19:19:15 GMT</pubDate>
			<description>What post-estimation command can be used in Stata to determine the sample size of each of the categories of a categorical predictor variable when the...</description>
			<content:encoded><![CDATA[What post-estimation command can be used in Stata to determine the sample size of each of the categories of a categorical predictor variable when the multivariate linear regression analysis dropped some cases due to missing certain variables?<br />
For example, my outcome variable is los (length of stay). My main predictor variable is myo (myocardial infarction) where 0=no, and 1=yes. I have additional predictors such as age, race, and income. I would dummy code race and income since each has more than two categories. The total sample size is 5,000 people with or without myocardial infarction. However, some people are missing information for los, age, and income. These people were not included in the multivariate analysis and the multivariate linear regression analysis only analyzed 4,800 people. What command can be included after my regression command to determine how many people from this regression analysis had a)no for myocardial infarction and b)yes for myocardial infarction? Would this be the same approach for income that has 3 categories? I am using Stata Version 17<br />
The regression command could be<br />
regress los myo age i.race i.income<br />
Thanks.<br />
Joshua<br />
 ]]></content:encoded>
			<category domain="https://www.statalist.org/forums/forum/general-stata-discussion/general">General</category>
			<dc:creator>Joshua Fogel</dc:creator>
			<guid isPermaLink="true">https://www.statalist.org/forums/forum/general-stata-discussion/general/1788067-command-multivariate-linear-regression-for-sample-size-of-categories-in-categorical-variable-when-cases-dropped-due-to-missing-data</guid>
		</item>
		<item>
			<title><![CDATA[Hsu's multiple comparisons with the best treatment (MCB) -- any packages available?]]></title>
			<link>https://www.statalist.org/forums/forum/general-stata-discussion/general/1788054-hsu-s-multiple-comparisons-with-the-best-treatment-mcb-any-packages-available</link>
			<pubDate>Tue, 10 Nov 2026 21:36:38 GMT</pubDate>
			<description><![CDATA[Does anyone know of a Stata package for Hsu's multiple comparisons with the best treatment (MCB) procedure? 
 
 https://www.jstor.org/stable/2288211...]]></description>
			<content:encoded><![CDATA[Does anyone know of a Stata package for Hsu's multiple comparisons with the best treatment (MCB) procedure?<ul><li><a href="https://www.jstor.org/stable/2288211" target="_blank">https://www.jstor.org/stable/2288211</a></li>
</ul> Thanks,<br />
Bruce]]></content:encoded>
			<category domain="https://www.statalist.org/forums/forum/general-stata-discussion/general">General</category>
			<dc:creator>Bruce Weaver</dc:creator>
			<guid isPermaLink="true">https://www.statalist.org/forums/forum/general-stata-discussion/general/1788054-hsu-s-multiple-comparisons-with-the-best-treatment-mcb-any-packages-available</guid>
		</item>
		<item>
			<title>New package dwlsmv, WLSMV estimation of SEM/CFA for binary and ordinal indicators in Stata</title>
			<link>https://www.statalist.org/forums/forum/general-stata-discussion/general/1788052-new-package-dwlsmv-wlsmv-estimation-of-sem-cfa-for-binary-and-ordinal-indicators-in-stata</link>
			<pubDate>Tue, 10 Nov 2026 19:09:12 GMT</pubDate>
			<description>I am excited to share a new Stata package, dwlsmv, which implements weighted least squares mean- and variance-adjusted (WLSMV) estimation for binary...</description>
			<content:encoded><![CDATA[I am excited to share a new Stata package, dwlsmv, which implements weighted least squares mean- and variance-adjusted (WLSMV) estimation for binary and ordinal indicators. It fits single- and multiple-group confirmatory factor and structural equation models, and exploratory factor models with oblique geomin rotation.<br />
<br />
The test statistic is the scaled-and-shifted (T3) mean- and variance-adjusted chi-square, the correction Mplus has used for WLSMV since version 6 (Asparouhov and Muthén, 2010). The &quot;d&quot; stands for the diagonal weight matrix used in estimation; the full asymptotic covariance matrix is still used for the robust standard errors and the test statistic (Muthén, du Toit, and Spisic, 1997).<br />
<br />
The current release is v0.3.0. Stata 16 is the floor, and it has been tested on Stata 16.1, 18 and 19 on Windows (macOS and Linux are not yet tested). This is a Mata implementation and should work across platforms.<br />
<br />
Installation:<br />

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code">net install dwlsmv, from(&quot;https://raw.githubusercontent.com/bbachilles/dwlsmv/v0.3.0/dist/&quot;)
net get dwlsmv // example data
help dwlsmv</pre>
</div>Source, specification and derivations are available at <a href="https://github.com/bbachilles/dwlsmv" target="_blank">https://github.com/bbachilles/dwlsmv</a>. The code is licensed under GPL-3.0-or-later; the specification, derivations and documentation under CC BY 4.0.<br />
<br />
This was built in close collaboration with and using Claude Code (code generated by Opus) with ChatGPT utilized as an independent sounding board in highly technical decision making (see follow-up post).<br />
<br />
What v0.3.0 supports<ul><li>Single- and multiple-group factor models with binary and ordinal indicators, including regression paths between latent variables. Missing data are handled by listwise deletion.</li>
<li>Cross-sectional measurement invariance (configural, thresholds, metric, scalar) following the Wu and Estabrook (2016) parameterization, using group() with metric(unitvariance). One deliberate restriction: invariance testing is not yet supported for factors measured only by binary indicators. Beyond metric invariance their identification is unresolved, so dwlsmv refuses these models rather than fitting them.</li>
<li>Nested model comparison with the included difftest command: a mean- and variance-adjusted chi-square difference test (Asparouhov and Muthén, 2006) for single-group models and for nested invariance levels across groups. difftest checks that the models are nested and refuses the comparison when they are not, including models nested only through a reparameterization.</li>
<li>EFA with oblique geomin rotated loadings and factor correlations (point estimates only).</li>
<li>Fit indices: CFI, TLI and RMSEA, with changes in CFI and RMSEA between invariance levels.v0.3.0 necessarily has some limitations in its capability.</li>
</ul>Syntax follows Stata's sem path notation, so it should feel familiar to sem users:<br />

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code">use dwlsmv_example, clear
dwlsmv (F1 -&gt; y1 y2 y3) (F2 -&gt; y4 y5 y6) (F2 &lt;- F1) // first loading of each factor fixed to 1
dwlsmv (F1 -&gt; y1 y2 y3) (F2 -&gt; y4 y5 y6) (F2 &lt;- F1), metric(unitvariance) // factor variances fixed to 1
dwlsmv (F1 F2 -&gt; y1-y6), efa(F1 F2) // EFA, oblique geomin</pre>
</div>dwlsmv is actively being developed and contributors are welcome! Planned development aims to address these:<ul><li>Geomin rotated standard errors in EFA</li>
<li>Observed covariates that are not part of measurement models. These require implementation of polyserial correlations, which was out of scope for v0.3.0.</li>
<li>Unlimited parameter constraints. Currently only loading constraints for identifying the marker of a factor and those related to measurement invariance are supported,</li>
<li>Second order or hierarchical factor structures, including latent &quot;curve of factors&quot; models.</li>
<li>vce options, focused on vce(cluster clusterid)</li>
<li>Exploratory structural equation modeling (ESEM)</li>
</ul>Feedback, bug reports and feature requests are welcome here or as GitHub issues (<a href="https://github.com/bbachilles/dwlsmv/issues" target="_blank">https://github.com/bbachilles/dwlsmv/issues</a>). The README includes citation information.<br />
<br />
References<br />
Asparouhov, T., and B. Muthén. 2006. Robust chi square difference testing with mean and variance adjusted test statistics. Mplus Web Notes No. 10.<br />
Asparouhov, T., and B. Muthén. 2010. Simple second order chi-square correction. Technical appendix, Mplus.<br />
Muthén, B., S. H. C. du Toit, and D. Spisic. 1997. Robust inference using weighted least squares and quadratic estimating equations in latent variable modeling with categorical and continuous outcomes. Unpublished manuscript.<br />
Wu, H., and R. Estabrook. 2016. Identification of confirmatory factor analysis models of different levels of invariance for ordered categorical outcomes. Psychometrika 81: 1014–1045.<br />
 ]]></content:encoded>
			<category domain="https://www.statalist.org/forums/forum/general-stata-discussion/general">General</category>
			<dc:creator>Erik Ruzek</dc:creator>
			<guid isPermaLink="true">https://www.statalist.org/forums/forum/general-stata-discussion/general/1788052-new-package-dwlsmv-wlsmv-estimation-of-sem-cfa-for-binary-and-ordinal-indicators-in-stata</guid>
		</item>
		<item>
			<title>choice of statistical analysis in study concerning stroke patients transportation pathway to the hospital (table 1)</title>
			<link>https://www.statalist.org/forums/forum/general-stata-discussion/general/1788043-choice-of-statistical-analysis-in-study-concerning-stroke-patients-transportation-pathway-to-the-hospital-table-1</link>
			<pubDate>Tue, 10 Nov 2026 14:13:09 GMT</pubDate>
			<description>Hello statalist! 
 
Me and my colleague (both upcoming doctors in Denmark primo 2027) have made a table 1 for stroke severity and comorbidity as...</description>
			<content:encoded><![CDATA[Hello statalist!<br />
<br />
Me and my colleague (both upcoming doctors in Denmark primo 2027) have made a table 1 for stroke severity and comorbidity as variables and we are looking into if differences in these variables between patients experiencing stroke factor into whether or not the transportation pathway ends up being an ambulance or another less efficient mode of transport. We wonder if linear regression or t-tests on table 1 is a more suiting choice of statistical analysis in a table with a lot of variables<br />
Any takes on this? Hope the question makes sense<br />
<br />
Regards<br />
two upcoming doctors]]></content:encoded>
			<category domain="https://www.statalist.org/forums/forum/general-stata-discussion/general">General</category>
			<dc:creator>Oskar Dahl</dc:creator>
			<guid isPermaLink="true">https://www.statalist.org/forums/forum/general-stata-discussion/general/1788043-choice-of-statistical-analysis-in-study-concerning-stroke-patients-transportation-pathway-to-the-hospital-table-1</guid>
		</item>
		<item>
			<title><![CDATA[_h2oframe  expressions with . and translation to h2o expression: what does &amp;lt;. mean in h2o?]]></title>
			<link>https://www.statalist.org/forums/forum/general-stata-discussion/general/1788020-_h2oframe-expressions-with-and-translation-to-h2o-expression-what-does-mean-in-h2o</link>
			<pubDate>Mon, 09 Nov 2026 18:29:49 GMT</pubDate>
			<description><![CDATA[scenario - statanow 19.5se 04nov26 update, macos 27, h2o cluster version 3.46.0.12 
problem - stata expression 'if x &lt; .' apparently never true in...]]></description>
			<content:encoded><![CDATA[scenario - statanow 19.5se 04nov26 update, macos 27, h2o cluster version 3.46.0.12<br />
problem - stata expression 'if x &lt; .' apparently never true in h2o<br />
specific case: i hav4 been trying to manipulate data in frames, specifically delete rows in frames where a specific variable is missing<br />
i already ran afoul of the column preference for _h2oframe drop, and undertand that i cannot drop rows based on 'if', but can keep rows based on 'if'<br />
so, i was trying to keep rows in a frame if a variable was not missing, and used my favorite stata shortcut if x&lt;. to catch all observations if x was not missing (x being type double, int, or real)<br />
issuing this command:<br />

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code">_h2oframe keep if x&lt;.</pre>
</div>results in all observations gone<br />
<br />
see the following code fradments for real output:<br />
<br />

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code">_h2oframe change ok3a
_h2oframe summarize
_h2oframe list
            x1          x2          x3   ok1  ok2  ok3  
1  1.4063101   -.8556733    .5506368     1    1    1 
2   .3292165  -1.5697292  -1.2405127     2    0    .  
3 -2.1004126    -.434219  -2.5346317     3    1    1  
4 -2.7012498   -.0149303  -2.7161801     4    0    .  
5 -1.6012208   -.1393668  -1.7405876     5    1    1  
6  1.0830827   -.5246539    .5584288     6    0    .  
7 -1.1185268    1.537264    .4187372     7    1    1  
8   1.905912   -.0175014   1.8884107     8    0    .  
9  2.0107517    .5497353    2.560487     9    1    1
10  -.6444256   -.5149793   -1.159405    10    0    .  

[10 rows x 6 columns]  _h2oframe keep if ok3&lt;.

_h2oframe list

_h2oframe put, into(ok3a) replace
_h2oframe list
 Progress (%): 0 100            

x1          x2          x3   ok1  ok2  ok3  
1  1.4063101   -.8556733    .5506368     1    1    1  
2   .3292165  -1.5697292  -1.2405127     2    0    .  
3 -2.1004126    -.434219  -2.5346317     3    1    1  
4 -2.7012498   -.0149303  -2.7161801     4    0    .  
5 -1.6012208   -.1393668  -1.7405876     5    1    1  
6  1.0830827   -.5246539    .5584288     6    0    .  
7 -1.1185268    1.537264    .4187372     7    1    1  
8   1.905912   -.0175014   1.8884107     8    0    .  
9  2.0107517    .5497353    2.560487     9    1    1
10  -.6444256   -.5149793   -1.159405    10    0    .  
[10 rows x 6 columns]  

_h2oframe drop if ok3 ==. _h2oframe list    

 if not allowed r(101);

_h2oframe keep if ok3 != .
_h2oframe list
  
           x1         x2          x3  ok1  ok2  ok3
1  1.4063101  -.8556733    .5506368    1    1    1
2 -2.1004126   -.434219  -2.5346317    3    1    1
3 -1.6012208  -.1393668  -1.7405876    5    1    1
4 -1.1185268   1.537264    .4187372    7    1    1
5  2.0107517   .5497353    2.560487    9    1    1

 [5 rows x 6 columns]</pre>
</div>so, not all expressions that are allowed in stata will work in h2o. specifically, what how does h2o evaluate 'missing' for a numerical variable? or is it not evaluated? it must mean something, because the expression !. is evaluated. thanks in advance - these nuances are critical and i could not find documentation in stata or h2o refs.]]></content:encoded>
			<category domain="https://www.statalist.org/forums/forum/general-stata-discussion/general">General</category>
			<dc:creator>George Hoffman</dc:creator>
			<guid isPermaLink="true">https://www.statalist.org/forums/forum/general-stata-discussion/general/1788020-_h2oframe-expressions-with-and-translation-to-h2o-expression-what-does-mean-in-h2o</guid>
		</item>
		<item>
			<title>Code to generate estimated multivariate time series model with the coefficients</title>
			<link>https://www.statalist.org/forums/forum/general-stata-discussion/general/1788019-code-to-generate-estimated-multivariate-time-series-model-with-the-coefficients</link>
			<pubDate>Mon, 09 Nov 2026 17:24:06 GMT</pubDate>
			<description>Good day all, 
 
Please, I need the Stata command to write out my model with the estimated coefficients. For instance, I have done the following...</description>
			<content:encoded><![CDATA[Good day all,<br />
<br />
Please, I need the Stata command to write out my model with the estimated coefficients. For instance, I have done the following regression with 10 explanatory variables in Stata:<br />
<br />
 newey LIS prevLIS imports equities infotechperm sqrcostofadmin investmenteducation sqrgdppercapita VASmanu corruptionindexr VASagric, lag(0)<br />
<br />
I followed this code to generate the equation:<br />
sysuse auto<br />
regress mpg weight<br />
matrix m = e(b)<br />
local a = m[1,2]<br />
local b = m[1,1]<br />
file open dofile using &quot;dofile.do&quot;, read write<br />
file write dofile &quot;gen y = `a' + `b'*weight&quot;<br />
file close dofile<br />
<br />
The file &quot;dofile.do&quot;, which you can apply to the external data, contains this line:<br />
Code:<br />
<br />
gen y = 39.44028353071797 + -.0060086868119993*weight<br />
<br />
Here is what I came up with:<br />
<br />
matrix m = e(b)<br />
local a = m[1,11]<br />
local b = m[1,10]<br />
file open dofile using &quot;dofile.do&quot;, read write<br />
file write dofile&quot;gen  LIS = ‘a’ + _’b’*prevLIS +_’b’*imports + _’b’*equities + _’b’*infotechperm + _’b’*sqrcostofadmin + _’b’*investmenteducation + _’b’*sqrgdppercapita + _’b’* VASmanu + _’b’*corruptionindexr + _’b’*VASagric, lag(0)&quot;<br />
file close dofile<br />
<br />
gen  LIS = 5.53409598195157 + _'b'*prevLIS +_'b'*imports + _'b'*equities + _'b'*infotechperm + _'b'*sqrcostofadmin + _'b'*investmenteducation + _'b'*sqrgdppercapita + _'b'* VASmanu + _'b'*corruptionindexr + _'b'*VASagric, lag(0)0)<br />
<br />
The output in my dofile only shows the constant as shown above.<br />
<br />
What should I do to generate the equation with all the coefficients?<br />
  <br />
Thank you.<br />
<br />
Florence Ijagbone<br />
<br />
<br />
 ]]></content:encoded>
			<category domain="https://www.statalist.org/forums/forum/general-stata-discussion/general">General</category>
			<dc:creator>Florence Ijagbone</dc:creator>
			<guid isPermaLink="true">https://www.statalist.org/forums/forum/general-stata-discussion/general/1788019-code-to-generate-estimated-multivariate-time-series-model-with-the-coefficients</guid>
		</item>
	</channel>
</rss>
