juancaros / quaidsce

Censored QUAIDS for Stata
9 stars 7 forks source link

unknown function *() and nocensor variable #1

Open hermelino opened 8 months ago

hermelino commented 8 months ago

Hi, everyone. I wish everything is good.

I am using quaidsce at POF Brazilian expenditure households data and two issues are happening. First, with the code:

quaidsce share1 share2 share3 share4 share5 share6 share7 share8 share9 share10, reps(100) prices(price1 price2 price3 price4 price5 price6 price7 price8 price9 price10) expenditure(desp_corr) demographics(anos_estudo urbano) anot(1.6) nocensor

and I get the following issue:

child process <each of child's processors numbers> Exited with error -133- while running the command/dofile (view log)...

with the log viewer:

. local result = _rc

. if (c(rc)) {
. cd "C:/POF/engel/"
. mata: parallel_write_diagnosis(strofreal(c("rc")),"C:/POF/engel/__pll1dmgwuza
> m3_finito0004","while setting memory")
. clear
. exit
. }

. 
. * Checking for break *
. mata: parallel_break()

. 
. * Loading Globals *
. capture {

. if (c(rc)) {
.   cd "C:/POF/engel/"
.   mata: parallel_write_diagnosis(strofreal(c("rc")),"C:/POF/engel/__pll1dmgwu
> zam3_finito0004","while loading globals")
.   clear
.   exit
. }

. 
. * Checking for break *
. mata: parallel_break()

. capture {
. 
. * Checking for break *
. mata: parallel_break()
.     use __pll1dmgwuzam3_bs_dta.dta, clear
.     if (`pll_instance'==$PLL_CHILDREN) local reps = 20
.     else local reps = 16
.     local pll_instance : di %04.0f `pll_instance'
.     bs , sav(__pll`pll_id'_bs_eststore`pll_instance', replace  )  rep(`reps')
> : quaidsce_c share1 share2 share3 share4 share5 share6 share7 share8 share9 s
> hare10 , reps(100) prices(price1 price2 price3 price4 price5 price6 price7 pr
> ice8 price9 price10) expenditure(desp_corr) demographics(anos_estudo urbano) 
> anot(1.6) nocensor
(running quaidsce_c on estimation sample)
unknown function *()
an error occurred when bootstrap executed quaidsce_c
r(133);
.   }

. if (c(rc)) {
.   cd "C:/POF/engel/"
C:\POF\engel
.   mata: parallel_write_diagnosis(strofreal(c("rc")),"C:/POF/engel/__pll1dmgwu
> zam3_finito0004","while running the command/dofile")
.   clear
.   exit

end of do-file

Adding that with quaids package and the same data I could get successful in the estimation. The second issue is that, when I effective enable the censored variable control, the log issue is the following:

.     bs , sav(__pll`pll_id'_bs_eststore`pll_instance', replace  )  rep(`reps')
> : quaidsce_c share1 share2 share3 share4 share5 share6 share7 share8 share9 s
> hare10 , reps(100) prices(price1 price2 price3 price4 price5 price6 price7 pr
> ice8 price9 price10) expenditure(desp_corr) demographics(anos_estudo urbano) 
> anot(1.6)
(running quaidsce_c on estimation sample)
no censoring for share10 found
an error occurred when bootstrap executed quaidsce_c
r(499);

My variables share1-share9 are food expenditures, while share10 are all non-food consumption and don't have any zero value observation. How can I deal with this?

fernandezm2 commented 8 months ago

Hi Hermelino, I would suggest to check if your code runs with the ssc version of quaidsce. I encountered similar problems using the github version. Also, try checking if demographics are balanced. That is, that you don't have just a few observations for a particular groups of households. Another problem I encountered is the imputation of prices to zero budgets, I simply forgot to do it and the command refused to run. Lastly, try testing the specification without bootstrapping. Hope it helps, Mario

From: Hermelino Nepomuceno de Souza @.> Sent: Thursday, February 8, 2024 5:25 AM To: juancaros/quaidsce @.> Cc: Subscribed @.**> Subject: [juancaros/quaidsce] unknown function () and nocensor variable (Issue #1)

You don't often get email from @.**@.>. Learn why this is importanthttps://aka.ms/LearnAboutSenderIdentification

Hi, everyone. I wish everything is good.

I am using quaidsce at POF Brazilian expenditure households data and two issues are happening. First, with the code:

quaidsce share1 share2 share3 share4 share5 share6 share7 share8 share9 share10, reps(100) prices(price1 price2 price3 price4 price5 price6 price7 price8 price9 price10) expenditure(desp_corr) demographics(anos_estudo urbano) anot(1.6) nocensor

and I get the following issue:

child process <each of child's processors numbers> Exited with error -133- while running the command/dofile (view log)...

with the log viewer:

`> -

. local result = _rc

. if (c(rc)) { . cd "C:/POF/engel/" . mata: parallel_write_diagnosis(strofreal(c("rc")),"C:/POF/engel/__pll1dmgwuza

m3_finito0004","while setting memory") . clear . exit . }

. . Checking for break . mata: parallel_break()

. . Loading Globals . capture {

. if (c(rc)) { . cd "C:/POF/engel/" . mata: parallel_write_diagnosis(strofreal(c("rc")),"C:/POF/engel/__pll1dmgwu

zam3_finito0004","while loading globals") . clear . exit . }

. . Checking for break . mata: parallel_break()

. capture { . . Checking for break . mata: parallel_break() . use pll1dmgwuzam3_bs_dta.dta, clear . if (pll_instance'==$PLL_CHILDREN) local reps = 20 . else local reps = 16 . local pll_instance : di %04.0f pll_instance' . bs , sav(pllpll_id'_bs_eststorepll_instance', replace ) rep(`reps')

: quaidsce_c share1 share2 share3 share4 share5 share6 share7 share8 share9 s hare10 , reps(100) prices(price1 price2 price3 price4 price5 price6 price7 pr ice8 price9 price10) expenditure(desp_corr) demographics(anos_estudo urbano) anot(1.6) nocensor (running quaidsce_c on estimation sample) unknown function *() an error occurred when bootstrap executed quaidsce_c r(133); . }

. if (c(rc)) { . cd "C:/POF/engel/" C:\POF\engel . mata: parallel_write_diagnosis(strofreal(c("rc")),"C:/POF/engel/__pll1dmgwu

zam3_finito0004","while running the command/dofile") . clear . exit

end of do-file ` Adding that with quaids package and the same data I could get successful in the estimation. The second issue is that, when I effective enable the censored variable control, the log issue is the following:

. bs , sav(__pllpll_id'_bs_eststorepll_instance', replace ) rep(reps')

: quaidsce_c share1 share2 share3 share4 share5 share6 share7 share8 share9 s hare10 , reps(100) prices(price1 price2 price3 price4 price5 price6 price7 pr ice8 price9 price10) expenditure(desp_corr) demographics(anos_estudo urbano) anot(1.6) (running quaidsce_c on estimation sample) no censoring for share10 found an error occurred when bootstrap executed quaidsce_c r(499); `

My variables share1-share9 are food expenditures, while share10 are all non-food consumption and don't have any zero value observation. How can I deal with this?

- Reply to this email directly, view it on GitHubhttps://github.com/juancaros/quaidsce/issues/1, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A2ILX6IQQZ33LTHTSYJYF5DYSOTFLAVCNFSM6AAAAABC6EETJCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGEZDGNBRGIYDMOA. You are receiving this because you are subscribed to this thread.Message ID: @.**@.>>

hermelino commented 8 months ago

Hi Mario. Thank you for suggestions. I was really using the github file installations, changing to ssc the last issues messages do not ocurr. But now with the same code I am getting the message hare1 not found. Putting set trace on I see that message occur because of line local xn = substr("share1",2,.) but I don't know why it's trying to do that.

- tempname xn loc
    - local xn = substr("`x'",2,.)
    = local xn = substr("share1",2,.)
    - if `xn'==1 {
    = if hare1==1 {
hare1 not found
      mat tau= e(b)'
      mat setau[1,1]= e(V)
      }
      else {
      mat tau=tau \ e(b)'
      local loc = `np_prob'*(`xn'-1)+1
      mat setau[`loc',`loc'] = e(V)
      }
      quietly predict du`x'
      if e(N) < _N {
      di as error "at least one variable completely predicts probit outcome, check your data"
      exit 499
      }
      qui replace pdf`x'= normalden(du`x')
      qui replace cdf`x'= normal(du`x')
      }
      local pdf `pdf' pdf`x'
      local cdf `cdf' cdf`x'
      local du `du' `du`x''
      }
    --------------------------------------------------------------------------------- end quaidsce.Estimate ---
  -------------------------------------------------------------------------------------------- end quaidsce ---
r(111);

end of do-file

I also check the demographics variables, its looks fine, and I already make the imputations of prices. About "try testing the specification without bootstrapping", I think I don't understand. I yet don't make any specification test, and checking the help package there are a bootstrap option only as type of standard error estimation. Would you please explain?

I am gratifully. Hermelino