Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • AI hallucinations about Stata

    In response to my Google search “stata accessing e(sample) in mata” I received an “AI overview” which started with
    You can access e(sample) in Mata by using the st_isdev() function, which retrieves the estimation sample as a boolean vector. However, a more common approach is to pass the sample information to Mata as a variable or matrix from Stata, as Mata is not designed to directly access Stata's internal macros.
    Method 1: Access with st_isdev()
    This is a direct way to get the e(sample) variable, which contains a 0 or 1 for each observation.
    • Call st_isdev() in your Mata code.
    • This function returns a vector indicating which observations were in the estimation sample.
    • Example: boolean sample = st_isdev()
    This seemed helpful until I realized that st_isdev() does not exist in Mata, nor does a boolean data type.

    Problematic but perhaps reassuring that our AI overlords aren’t ready to take power yet.

    (This is a Mata-related issue, but I thought this might be interesting to general users)
Working...
X