Announcement

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

  • parallel invalid '-' r(3598)

    Hi, I am working on bootstrap internal validation using Stata. I had developed these programs few months ago and tried running it again earlier this week, but I encountered
    Code:
    r(3598)
    error.

    Please find the programs here:
    Code:
    *===============================================================================
    * PROGRAM 1: Forward Selection using QIC
    * Returns: selected variables as local macro
    *===============================================================================
    capture program drop forward_select_qic
    program define forward_select_qic, rclass
        syntax varlist(min=1), outcome(varname) [penter(real 0.10)]
        
        local candidates `varlist'
        local selected ""
        local best_qic = .
        local keep_adding = 1
        
        *---------------------------------------------------------------------------
        * Step 1: Univariable screening (p < penter)
        *---------------------------------------------------------------------------
        local candidates_pass ""
        foreach var of local candidates {
            capture quietly xtgee `outcome' `var', ///
                family(binomial) link(logit) corr(exchangeable) robust
            
            if _rc == 0 {
                local pval = 2*normal(-abs(_b[`var']/_se[`var']))
                if `pval' < `penter' {
                    local candidates_pass `candidates_pass' `var'
                }
            }
        }
        
        if "`candidates_pass'" == "" {
            return local selected ""
            exit
        }
        
        *---------------------------------------------------------------------------
        * Step 2: Forward selection based on QIC + p<0.05
        *---------------------------------------------------------------------------
        local remaining `candidates_pass'
        
        while `keep_adding' {
            local var_to_add = ""
            local new_best_qic = .
            local improved = 0
            
            * Try adding each remaining variable
            foreach var of local remaining {
                local test_vars `selected' `var'
                
                capture quietly qic `outcome' `test_vars', ///
                    family(binomial) link(logit) corr(exchangeable) robust
                
                if _rc == 0 {
                    local current_qic = r(qic)
                    
                    * Check if the new variable has p<0.05
                    capture quietly xtgee `outcome' `test_vars', ///
                        family(binomial) link(logit) corr(exchangeable) robust
                    
                    if _rc == 0 {
                        local pval_new = 2*normal(-abs(_b[`var']/_se[`var']))
                        
                        * Variable must have p<0.05
                        if `pval_new' < 0.05 {
                            * For first variable: find lowest QIC among all candidates
                            * For subsequent: only add if QIC improves
                            if "`selected'" == "" {
                                * First variable: select one with lowest QIC
                                if `new_best_qic' == . | `current_qic' < `new_best_qic' {
                                    local new_best_qic = `current_qic'
                                    local var_to_add = "`var'"
                                    local improved = 1
                                }
                            }
                            else {
                                * Subsequent variables: must improve current best QIC
                                if `current_qic' < `best_qic' {
                                    if `new_best_qic' == . | `current_qic' < `new_best_qic' {
                                        local new_best_qic = `current_qic'
                                        local var_to_add = "`var'"
                                        local improved = 1
                                    }
                                }
                            }
                        }
                    }
                }
            }
            
            * Add variable if improvement found
            if `improved' {
                local selected `selected' `var_to_add'
                local remaining : list remaining - var_to_add
                local best_qic = `new_best_qic'
                
                * Stop if no more candidates
                if "`remaining'" == "" {
                    local keep_adding = 0
                }
            }
            else {
                * No improvement possible
                local keep_adding = 0
            }
        }
        
        return local selected "`selected'"
    end
    
    *===============================================================================
    * PROGRAM 2: Bootstrap Internal Validation (Box 2)
    * Follows the exact steps from Box 2
    *===============================================================================
    capture program drop boot_internal_validation
    program define boot_internal_validation, rclass
        version 16.0
        syntax , reps(integer) [penter(real 0.10)]
        
        display as text "{hline 80}"
        display as text "Bootstrap Internal Validation (Following Box 2)"
        display as text "{hline 80}"
        display as text "Outcome: $outcome_var"
        display as text "Candidate predictors: " _c
        local n_cand : word count $candidates
        display as result `n_cand'
        display as text "Bootstrap replications: " as result `reps'
        display as text "Univariable screening: p<" as result `penter'
        display as text "Selection method: Forward selection by QIC (p<0.05 required)"
        display as text "{hline 80}" _newline
        
        preserve
        
        *---------------------------------------------------------------------------
        * STEP 1: Develop model on original data (apparent performance)
        *---------------------------------------------------------------------------
        display as text "STEP 1: Developing model on original dataset..."
        
        quietly xtset $cluster_id visit_number
        forward_select_qic $candidates, outcome($outcome_var) penter(`penter')
        local original_selected = r(selected)
        
        if "`original_selected'" == "" {
            display as error "No variables selected on original data!"
            display as text "Try increasing penter threshold or checking your data"
            restore
            exit
        }
        
        display as text "Selected variables: " as result "`original_selected'"
        
        * Fit final model on original data
        quietly xtgee $outcome_var `original_selected', ///
            family(binomial) link(logit) corr(exchangeable) robust
        
        predict xb_apparent, xb
        quietly roctab $outcome_var xb_apparent
        scalar auc_apparent = r(area)
        
        quietly logit $outcome_var xb_apparent, vce(cluster $cluster_id)
        scalar slope_apparent = _b[xb_apparent]
        drop xb_apparent
        
        display as text "  Apparent AUC: " as result %5.3f auc_apparent
        display as text "  Apparent Calibration Slope: " as result %5.3f slope_apparent
        display as text "{hline 80}" _newline
        
        *---------------------------------------------------------------------------
        * Initialize tracking matrices
        *---------------------------------------------------------------------------
        local n_candidates : word count $candidates
        tempname selection_matrix corrected_aucs corrected_slopes
        matrix `selection_matrix' = J(`reps', `n_candidates', 0)
        matrix `corrected_aucs' = J(`reps', 1, .)
        matrix `corrected_slopes' = J(`reps', 1, .)
        
        *---------------------------------------------------------------------------
        * STEPS 2-5: Bootstrap loop
        *---------------------------------------------------------------------------
        display as text "STEPS 2-5: Bootstrap resampling and optimism calculation..."
        
        tempname total_optimism_auc total_optimism_slope
        scalar `total_optimism_auc' = 0
        scalar `total_optimism_slope' = 0
        local successful = 0
        
        forvalues rep = 1/`reps' {
            if mod(`rep', 10) == 0 {
                display as text "  Bootstrap iteration `rep'/`reps' - " _c
                display as result %3.0f (`rep'/`reps'*100) as text "% complete"
            }
            
            restore, preserve
            
            capture noisily {
                *-------------------------------------------------------------------
                * STEP 2: Generate bootstrap sample
                *-------------------------------------------------------------------
                quietly bsample, cluster($cluster_id)
                
                * Create new sequential time index to avoid duplicates
                quietly bysort $cluster_id: gen _boot_time = _n
                quietly xtset $cluster_id _boot_time
                
                *-------------------------------------------------------------------
                * STEP 3: Develop bootstrap model (same methods as original)
                *-------------------------------------------------------------------
                forward_select_qic $candidates, outcome($outcome_var) penter(`penter')
                local boot_selected = r(selected)
                
                * Track which variables were selected
                if "`boot_selected'" != "" {
                    local col = 1
                    foreach var of global candidates {
                        local is_selected : list var in boot_selected
                        if `is_selected' {
                            matrix `selection_matrix'[`rep', `col'] = 1
                        }
                        local col = `col' + 1
                    }
                    
                    *---------------------------------------------------------------
                    * STEP 3a: Bootstrap performance (in bootstrap sample)
                    *---------------------------------------------------------------
                    quietly {
                        xtgee $outcome_var `boot_selected', ///
                            family(binomial) link(logit) corr(exchangeable) robust
                        predict xb_boot, xb
                        roctab $outcome_var xb_boot
                        local auc_boot = r(area)
                        logit $outcome_var xb_boot, vce(cluster $cluster_id)
                        local slope_boot = _b[xb_boot]
                        drop xb_boot _boot_time
                    }
                    
                    *---------------------------------------------------------------
                    * STEP 3b: Test performance (in original data)
                    *---------------------------------------------------------------
                    restore, preserve
                    quietly {
                        xtset $cluster_id visit_number
                        xtgee $outcome_var `boot_selected', ///
                            family(binomial) link(logit) corr(exchangeable) robust
                        predict xb_test, xb
                        roctab $outcome_var xb_test
                        local auc_test = r(area)
                        logit $outcome_var xb_test, vce(cluster $cluster_id)
                        local slope_test = _b[xb_test]
                        drop xb_test
                    }
                    
                    *---------------------------------------------------------------
                    * STEP 4: Calculate optimism
                    *---------------------------------------------------------------
                    local optimism_auc = `auc_boot' - `auc_test'
                    local optimism_slope = `slope_boot' - `slope_test'
                    
                    scalar `total_optimism_auc' = `total_optimism_auc' + `optimism_auc'
                    scalar `total_optimism_slope' = `total_optimism_slope' + `optimism_slope'
                    
                    local successful = `successful' + 1
                    
                    *---------------------------------------------------------------
                    * Store corrected values for this iteration
                    *---------------------------------------------------------------
                    local auc_corrected_i = auc_apparent - `optimism_auc'
                    local slope_corrected_i = slope_apparent - `optimism_slope'
                    matrix `corrected_aucs'[`rep', 1] = `auc_corrected_i'
                    matrix `corrected_slopes'[`rep', 1] = `slope_corrected_i'
                }
            }
            
            if _rc {
                * Skip failed iterations silently
            }
        }
        
        restore
        
        *---------------------------------------------------------------------------
        * STEP 6: Average optimism
        *---------------------------------------------------------------------------
        if `successful' > 0 {
            scalar avg_optimism_auc = `total_optimism_auc' / `successful'
            scalar avg_optimism_slope = `total_optimism_slope' / `successful'
        }
        else {
            display as error "No successful bootstrap iterations!"
            exit
        }
        
        *---------------------------------------------------------------------------
        * STEP 7: Optimism-corrected estimates
        *---------------------------------------------------------------------------
        scalar auc_corrected = auc_apparent - avg_optimism_auc
        scalar slope_corrected = slope_apparent - avg_optimism_slope
        
        *---------------------------------------------------------------------------
        * Calculate 95% CIs from bootstrap distribution
        *---------------------------------------------------------------------------
        preserve
        clear
        svmat `corrected_aucs', names(auc_corr)
        svmat `corrected_slopes', names(slope_corr)
        drop if missing(auc_corr1)
        
        _pctile auc_corr1, p(2.5 97.5)
        scalar auc_ci_lower = r(r1)
        scalar auc_ci_upper = r(r2)
        
        _pctile slope_corr1, p(2.5 97.5)
        scalar slope_ci_lower = r(r1)
        scalar slope_ci_upper = r(r2)
        restore
        
        *---------------------------------------------------------------------------
        * Display results
        *---------------------------------------------------------------------------
        display as text _newline "{hline 80}"
        display as text "RESULTS: Internal Validation"
        display as text "{hline 80}"
        display as text "Original model variables: " as result "`original_selected'"
        display as text "Successful bootstrap iterations: " as result `successful' as text "/" as result `reps'
        display as text "{hline 80}"
        display as text "                          Apparent    Optimism    Corrected"
        display as text "{hline 80}"
        display as text "AUC                   " ///
            as result %9.3f auc_apparent "  " %9.3f avg_optimism_auc "  " %9.3f auc_corrected
        display as text "Calibration Slope     " ///
            as result %9.3f slope_apparent "  " %9.3f avg_optimism_slope "  " %9.3f slope_corrected
        display as text "{hline 80}"
        display as text "AUC (95% CI)          " ///
            as result %9.3f auc_corrected " (" %5.3f auc_ci_lower " - " %5.3f auc_ci_upper ")"
        display as text "Slope (95% CI)        " ///
            as result %9.3f slope_corrected " (" %5.3f slope_ci_lower " - " %5.3f slope_ci_upper ")"
        display as text "{hline 80}" _newline
        
        *---------------------------------------------------------------------------
        * Variable selection frequencies
        *---------------------------------------------------------------------------
        display as text "Variable Selection Frequencies Across Bootstrap Samples"
        display as text "{hline 80}"
        display as text "{col 5}Variable{col 40}Selected (n){col 55}Frequency (%)"
        display as text "{hline 80}"
        
        local col = 1
        foreach var of global candidates {
            local count = 0
            forvalues rep = 1/`reps' {
                local count = `count' + `selection_matrix'[`rep', `col']
            }
            local freq = (`count' / `successful') * 100
            
            if `freq' > 0 {
                display as text "{col 5}`var'{col 40}" as result `count' ///
                    as text "{col 55}" as result %5.1f `freq'
            }
            
            local col = `col' + 1
        }
        display as text "{hline 80}"
        
        *---------------------------------------------------------------------------
        * Return results
        *---------------------------------------------------------------------------
        return local original_model "`original_selected'"
        return scalar auc_apparent = auc_apparent
        return scalar auc_corrected = auc_corrected
        return scalar auc_ci_lower = auc_ci_lower
        return scalar auc_ci_upper = auc_ci_upper
        return scalar optimism_auc = avg_optimism_auc
        return scalar slope_apparent = slope_apparent
        return scalar slope_corrected = slope_corrected
        return scalar slope_ci_lower = slope_ci_lower
        return scalar slope_ci_upper = slope_ci_upper
        return scalar optimism_slope = avg_optimism_slope
        return scalar n_successful = `successful'
    end
    Here are the usage example:

    Code:
    webuse airacc, clear
    
    xtset airline time
    global cluster_id airline
    global candidates relcnt relsize pmiles ait uit
    global outcome_var rec
    
    parallel, prog(forward_select_qic): boot_internal_validation, reps(10) penter(0.10)
    invalid '-' 
                     stata():  3598  Stata returned error
    parallel_export_programs():     -  function returned error
         parallel_write_do():     -  function returned error
                     <istmt>:     -  function returned error
    r(3598);
    My question:
    1. What changed within Stata or parallel over the past few months? The codes had worked perfectly before but it's now returning error?
    2. I have checked and there are no en dash or em dashes that might break the loop. I don't know what is wrong.

    Thank you very much in advance.

  • #2
    It might be caused by running your program in a directory contains spaces, for example, if I save and run the do-file from "C:\Users\Hua Peng\Documents", it produces:

    Code:
    . webuse airacc, clear
    
    .
    . xtset airline time
    
    Panel variable: airline (strongly balanced)
     Time variable: time, 1 to 4
             Delta: 1 unit
    
    . global cluster_id airline
    
    . global candidates relcnt relsize pmiles ait uit
    
    . global outcome_var rec
    
    .
    .
    . parallel, prog(forward_select_qic): boot_internal_validation, reps(10) penter(0.10)
    invalid 'Peng'
                     stata():  3598  Stata returned error
    parallel_export_programs():     -  function returned error
         parallel_write_do():     -  function returned error
                     <istmt>:     -  function returned error
    r(3598);
    
    end of do-file
    
    r(3598);
    But if I save and run the do-file from "C:\aa1", it ran pass your original issue (I did not attempt to get you program work, it still failed in the later part since I did not put boot_internal_validation in ado path).

    Code:
    Parallel Computing with Stata (by GVY)
    Clusters   : 2
    pll_id     : p4vttdirq3
    Running at : c:\aa1
    Randtype   : datetime
    Waiting for the clusters to finish...
    cluster 0001 Exited with error -199- while running the command/dofile (view log)...
    cluster 0002 Exited with error -199- while running the command/dofile (view log)...
    --------------------------------------------------------------------------------
    Enter -parallel printlog #- to checkout logfiles.
    --------------------------------------------------------------------------------
    Last edited by Hua Peng (StataCorp); 10 Apr 2026, 10:17.

    Comment


    • #3
      Originally posted by Hua Peng (StataCorp) View Post
      It might be caused by running your program in a directory contains spaces, for example, if I save and run the do-file from "C:\Users\Hua Peng\Documents", it produces:

      Code:
      . webuse airacc, clear
      
      .
      . xtset airline time
      
      Panel variable: airline (strongly balanced)
      Time variable: time, 1 to 4
      Delta: 1 unit
      
      . global cluster_id airline
      
      . global candidates relcnt relsize pmiles ait uit
      
      . global outcome_var rec
      
      .
      .
      . parallel, prog(forward_select_qic): boot_internal_validation, reps(10) penter(0.10)
      invalid 'Peng'
      stata(): 3598 Stata returned error
      parallel_export_programs(): - function returned error
      parallel_write_do(): - function returned error
      <istmt>: - function returned error
      r(3598);
      
      end of do-file
      
      r(3598);
      But if I save and run the do-file from "C:\aa1", it ran pass your original issue (I did not attempt to get you program work, it still failed in the later part since I did not put boot_internal_validation in ado path).

      Code:
      Parallel Computing with Stata (by GVY)
      Clusters : 2
      pll_id : p4vttdirq3
      Running at : c:\aa1
      Randtype : datetime
      Waiting for the clusters to finish...
      cluster 0001 Exited with error -199- while running the command/dofile (view log)...
      cluster 0002 Exited with error -199- while running the command/dofile (view log)...
      --------------------------------------------------------------------------------
      Enter -parallel printlog #- to checkout logfiles.
      --------------------------------------------------------------------------------
      Thanks for the prompt response. I tried doing what you did C:\Users\name but it still didn't work.

      I ended up re-installing parallel using the latest stable version

      Code:
      net install parallel, from(https://raw.github.com/gvegayon/parallel/stable/) replace
      mata mata mlib index
      After this, a new error code appeared:

      Code:
      webuse airacc, clear
      xtset airline time
      
      global cluster_id airline
      global candidates relcnt relsize pmiles ait uit
      global outcome_var rec
      
      parallel, prog(forward_select_qic): boot_internal_validation, reps(10) penter(0.10)
               parallel_write_do():  3001  expected 2 to 12 arguments but received 14
               <istmt>:     -  function returned error
      r(3001);
      I have also tried putting the programs in my .ado folder but it still won't work.

      Thanks in advance.

      UPDATE: After uninstalling the old SSC parallel and install the latest stable version from GitHub, I am able to reproduce your error.

      Code:
      Parallel Computing with Stata
      Child processes: 4
      pll_id         : v68a3x9l23
      Running at     : C:\Users\name
      Randtype       : datetime
      Waiting for the child processes to finish...
      child process 0002 Exited with error -199- while running the command/dofile (view log)...
      child process 0003 Exited with error -199- while running the command/dofile (view log)...
      child process 0004 Exited with error -199- while running the command/dofile (view log)...
      child process 0001 Exited with error -199- while running the command/dofile (view log)...
      --------------------------------------------------------------------------------
      Enter -parallel printlog #- to checkout logfiles.
      
      Log-files:
      . capture {
      -------------------------------------------------------------------------------
      > -
      Parallel computing with Stata
      -------------------------------------------------------------------------------
      > -
      cmd/dofile   : "boot_internal_validation , reps(5000) penter(0.10)"
      pll_id       : v68a3x9l23
      pll_instance : 1/4
      tmpdir       : C:\Users\name\AppData\Local\Temp/__pllv68a3x9l23_tmpdir0001/
      date-time    : 16:13:51 11 Apr 2026
      seed         : XAA000000000000b29ccdb84ada9d86c96dc305902973a4fa58525deeffe72a2
      > 7025730bd4e2482588bfdc415419528064772fce1a1e8b8d5fa1f922823a9bc222606649cca53
      > 20dab60cb9fbd93d34bc077ff10b4b6f9f8645908c264c183a55ffda6128595b2aa0851b0f12f
      > 4621eb19bcc23be78dcb81d4db99f0f50594cd8c53dec1e7d11dfd40b3fa90402dcf0bb00ac82
      > 0ebd1a15df12127e89f203d125e3325ea450deae45fb1f14e203d870d23479ec9e42cc60bf3aa
      > f997b95bd36e2767dcdccc0ba815a7c45d49a86bb61eb12dc5b90c2f9e3bf710f2789ac2e5c35
      > 2517cb9536cf1bb29d95fb391fb6db48b6af09a524ae6113c2fd6103124e9cb8df32ec15fc794
      > da2ccc6b9d1ef2724d1fd089d43e0c67bebc81fdcd341f928aa4bea2d5f9c5a4824535bd0f81a
      > 8b4212352e0635c049e8ff4ad24f6fe022ac962992f6b40395473b8ac75d8ab99a35ef11a31c6
      > 8a85a8ef454b401fb6094659d4917d5c59e4f8bdb5b3ad262cf0d5eb42c6fc6975f42a37fea5b
      > 3fa9400afa117e9c8145c4df8e14833e9fc8f8033a99de4b4b480219d82e38ecf15fc19d1b673
      > 84923d6f0cf5e6a939404dc75a97129df88ba56e1e649ff0f48eb91067f1a4880b26931b1e0ab
      > bde5f4a748aaccd8fad415ee2a3279b7c105e12a8c6361f7691cda8b79ba58aedbafa939ebf94
      > 0d2f179f5b92b0f1b7777dd89592e6cc4ad34454d23df8000b469bbe93a9ff0616bdbf38d017f
      > d7e4c1b9720f7d93ed7f3c28f3d1f48bc12f52bffb18caa22eba1fc6dd0b950cedd5de981fa77
      > 61c12c3a31ebac5dc4fc1d101aea0aa78603b9bcd8ff06fc027affd655bd4bddd04578258cfbc
      > 215e04cf4a41c6b2a5df02d62cbc3b975e912847285e647f6023a874d1c82c75ec5e77b37dc15
      > cb4040d672c527f157c9ee0d4dbdd2b4b1e28cdf5c9622b183fd91c597473458467a667ceff7e
      > 19e1e92d4fe8e943674ba55fd51f061ab82758b45f72d660b111fda83097e10478ab2ca51aafe
      > 8efe7e9701018a748efed97655405a5d524a7b81d8c0510d91e1d414901a9d8b3132faf8dad99
      > 80a71089cf2862eb7aaa517140c2f2e352c315881fa8e22bd2a9832a667180fab7ff8fa0906d2
      > 7be9304eb7b74e7046bb6da422526007e10a0152c61ae665bd34d7958a3c1820131e617570801
      > 6f5a3c1ae00eb951ec7353c1889128fa13e48f8945bcbce395c488a0c2e0696bcadfad5f4626f
      > da9c2499957a2cb22965b8758dffa180d1441a03fbe4c6658cd37026ddf2037425dc2af9274a3
      > cd17b98c38ca2364f9df1069a81deede4e76f9e979eb2dc10aac83c4c1d02a62a35ae517ff2bc
      > 6ce134330fba1ef5204d872a410c80fd4d3c205c5a3e53757a17e2e1d9ac961ae81b4d71b6071
      > 294f3ed504ede3427dc4f0706aef37050197c811e5d6fc44618ff11bb9cecb9dcb182e60d1900
      > 2a78522e7cb465081e18653715d8c248984e2ea023414e2c5018146af95ff967fea12370a7581
      > 75d8f0dc23f77db05d05a476af2d82a454958553fc1c8cbcc813217bcf18e2549a869bba7a537
      > 985a4187640f207e408bf1dbb530f42f7a47c7886d308c2ccac67ff7f0de8782425cb07e17a21
      > 600cdaaa9d22cb7ff4f30a6056ebd3736278ab99af429a42e7d88257ce3ca0387b47f420f6f07
      > 6b47bf971d5d2da8bff02d0ba4552222965467d465ed30a3f5abcc33858aef97460bc8a2be92e
      > 3f67df6125965082911104f6a106a5749b0378f7efeea0599ebcad19e776559b18a1008fa250f
      > 38297d2920803b24c78400e742ad549f811bdeb9fd951608b7076501a33348011ab4e9ab8b683
      > 387184c437dd1c9fa5f004f8ba1d4d2a51aadffa8b077cb62a2d51245fdab5aa9fa6106024b69
      > c98c22177ebe4adf9aa676c66d5dba48d55bd296ad9e6753a2fe85f1fc11cbf665e539c97b05a
      > bcf42183f2b0199052ad7331f7f7f1d078c0b08f2019f6197edd71378b41144aed5d1a43394ac
      > 8bec189474ec8b3f16e0ae0acd897a2345b619ee200870077d3686e9010bbb46e35892f9c68ca
      > 86c5c826cf6f779371a2e2ae2b938479c12672af5f693024ffca5439c89c3c028c29d92c982d0
      > c64ddd77b9a1a61d85e94fb8be8bc6bd88a477e198ea80b3c0ab1d8d56f2b3b4b31aed0bc71ef
      > ff8d8f28ab26016b3def804fd3f08b993c90c14a32795672a0d231979eaab4893c6fa14e93cae
      > c5271e00f20b8444ddd12ae87bfc6b50c3afb059fff1af37df6d8072413dabee7c42735c51f6b
      > 862baa9a888ab59793bbf11193ae6e0d1c4cd0ef593dc72a477cba612895c7619efc0777430dc
      > 8444053edec9d2423e17ce95eac5638c96b3167b016e63252dd1a34d327bd066842b5659042b0
      > 36a19db2a6586f32faf3cccdc83e70b8ac31acb9884a7efd139f8e240bcfe598566fd50026ed9
      > 818450071c56e5bd53f9f5f4d0891ccb5f4a65f8b518e8f173fe160604c91010d143d1568fd6e
      > 19d37fa960b88f6419e3ece5eae0c6f78a46ba82a699c4e0bcfba1d2e07dbf3b92589a309a4a1
      > fb2195f6e71201fb4907834be42afca67ba976c618aa6339b98521ef63ae5c7c740d8dbc8f626
      > dd4d18b293f8a067a4e35fb36479ce7b6c2d14d72f44532d43bec477ace173a5a9b8192e3a73b
      > 0bea161faf9586f55f72720f7168acfa7fd2e5eba084d180b6606060d03653f9bdc01e5deca61
      > 8c8a9b5c8a29298eae432f5878488b49bba207ec66ab6d20da76000730da31bab13c7a139936e
      > a292a286631df9d0af1d1b4e30078318c36b869dd06ce1d6754903fd0480df094511368888e96
      > c5b46502580e75b1a56eba136f16438f881bd5e9f106cf86baf605c4d83716764700f11fce217
      > ea56b4aef0e9bcbb1db6d06e96c9981c5d589d3257dfa07c1a3f4f6ca80efb51dd43d0b1c836e
      > 00727831403cac5703a0d133e1659f4a5e00da21fe7a6fb731816a8d7e1d0983a39104c07d3ba
      > e035406e9ea024a4c41268e1ed2aa16d74eb7bbd6f9ba5f3da1dba22e5d12f06d1b3059a484f8
      > 0fc596d62479b6016ab32dd86fb8ed0c73f53806497fa84db8f9534a9207f273f2ccda3f198fc
      > 6936fc7a0ca660a2acd3c6d7a94cba3935b83c77844a06908bf340e5e8f63ccf7a72b7f92de5d
      > 1205049f14734945d3b98394b0fcbf75197e567314b07ee0ae4a0cec1d086ce540c051c4e48d9
      > d33fb4ee4536447e1d64a88c30a3e42a9d1c7fe46f4f60eff1a9757f4a95ba76a1e2213b425dc
      > 04c15c20f9d7de5d960df1a9076268df553d6de889843fa1bf08de51fe4049710cb8caf05d2ee
      > b07030306a70ed089b8882576e2324dfa834aa76539a6bde5ba7a55848826f7075b2dec6655aa
      > 9cea5625ff025192e772d3b0d07c90a6e9dcfd45bb7ac8b58c4b5e88dec9020ce8034fb160703
      > 07edfc0a14c95c10dd486637be333571e64f76d6bc0a0d7687bfa9a35bc7e302918c294b5262b
      > afbbe84cfcce0bc2b74d671c7ecc51f49edb986862c17373ac127b12110b5b13e30d1943ae117
      > 2340001000001383331
      -------------------------------------------------------------------------------
      > -
      
      . local result = _rc
      
      . if (c(rc)) {
      . cd "C:\Users\name/"
      . mata: parallel_write_diagnosis(strofreal(c("rc")),"C:\Users\name/__pllv68a3x
      > 9l23_finito0001","while setting memory")
      . clear
      . exit
      . }
      
      . 
      . * Loading Programs *
      . capture {
      
      . local result = _rc
      
      . if (c(rc)) {
      . cd "C:\Users\name/"
      . mata: parallel_write_diagnosis(strofreal(c("rc")),"C:\Users\name/__pllv68a3x
      > 9l23_finito0001","while loading programs")
      . clear
      . exit
      . }
      
      . 
      . * Checking for break *
      . mata: parallel_break()
      
      . 
      . * Loading Globals *
      . capture {
      
      . if (c(rc)) {
      .   cd "C:\Users\name/"
      .   mata: parallel_write_diagnosis(strofreal(c("rc")),"C:\Users\name/__pllv68a
      > 3x9l23_finito0001","while loading globals")
      .   clear
      .   exit
      . }
      
      . 
      . * Checking for break *
      . mata: parallel_break()
      
      . capture {
      .     use "C:\Users\name/__pllv68a3x9l23_dataset" if _v68a3x9l23cut == 1
      .     drop _v68a3x9l23cut
      . 
      . * Checking for break *
      . mata: parallel_break()
      .     boot_internal_validation , reps(5000) penter(0.10) 
      command boot_internal_validation is unrecognized
      r(199);
      .   }
      
      . if (c(rc)) {
      .   cd "C:\Users\gilbe/"
      C:\Users\gilbe
      .   mata: parallel_write_diagnosis(strofreal(c("rc")),"C:\Users\name/__pllv68a
      > 3x9l23_finito0001","while running the command/dofile")
      .   clear
      .   exit
      
      end of do-file
      Now, I have tried installing the .ado file to my .ado path (C:\Users\name\ado\personal\), but it still won't work.

      Any idea what's missing? Thanks
      Last edited by Gilbert Lazarus; 11 Apr 2026, 03:16.

      Comment


      • #4
        Ok, I assumed you already have a boot_internal_validation.ado containing the boot_internal_validation program somewhere in your ado path, since that's not the case, I beleieve you need add the boot_internal_validation to the program list, i.e.

        Code:
        parallel, prog(forward_select_qic  boot_internal_validation): boot_internal_validation, reps(10) penter(0.10)
        Note, you example do-file still fails due to some missing variables, I suppose that's due to the sample dataset you choosed to use as an example.
        Last edited by Hua Peng (StataCorp); 11 Apr 2026, 12:11.

        Comment

        Working...
        X