Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: matrix colnames manipulation


From   <S.Jenkins@lse.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: matrix colnames manipulation
Date   Wed, 4 Jul 2012 10:06:08 +0100

I want to use estimates derived using -xtprobit- as starting values for
estimation using -gllamm, family(binomial) link(probit)
from(mat_start)-. (-gllamm- is on SSC.)  To use the "from" option, I
want to manipulate the full column names of the e(b) matrix produced by
-xtprobit-. The issue is that -gllamm- labels the column corresponding
to the variance of the random effect differently to -xtprobit-. So,
specifically, how, within a long list of colnames stored with a macro,
does one change the final name?

Here below is an illustration of the macro lists involved. I'm getting
stuck and wondering whether the issue is the length of the string held
in the macro. Specifically, in the illustration, I want to change
"lnsig2u:_cons" (relating to -xtprobit-) to "pid1:_cons" (relating to
-gllamm-)

. * -xtprobit- results

. estimates use estimation35_2

. mat bs = e(b)

. local namess: colfullnames bs

. di "`names'"


. di "`namess'"
bu_SA:Lfemale bu_SA:Lage50m bu_SA:Lhealthprob bu_SA:Ledq_low
bu_SA:Ledq_high bu_SA:Ledqmiss bu_SA:Lbu_nkids bu_S
> A:Lbu_ageykidlt5 bu_SA:Lbu_lparent bu_SA:Lbu_couple bu_SA:Ltenown
bu_SA:Lreg_london bu_SA:Lurate bu_SA:w3 bu_S
> A:w4 bu_SA:w5 bu_SA:w6 bu_SA:w7 bu_SA:w8 bu_SA:w9 bu_SA:w10 bu_SA:w11
bu_SA:w12 bu_SA:w13 bu_SA:w14 bu_SA:w15 
> bu_SA:Lbu_SA bu_SA:Lbu_SA_female bu_SA:Lbu_SA_age50m
bu_SA:Lbu_SA_healthprob bu_SA:Lbu_SA_edq_low bu_SA:Lbu_SA
> _edq_high bu_SA:Lbu_SA_edqmiss bu_SA:Lbu_SA_bu_nkids
bu_SA:Lbu_SA_bu_ageykidlt5 bu_SA:Lbu_SA_bu_lparent bu_SA:
> Lbu_SA_bu_couple bu_SA:Lbu_SA_tenown bu_SA:Lbu_SA_reg_london
bu_SA:Lbu_SA_urate bu_SA:Lbu_SA_w3 bu_SA:Lbu_SA_w
> 4 bu_SA:Lbu_SA_w5 bu_SA:Lbu_SA_w6 bu_SA:Lbu_SA_w7 bu_SA:Lbu_SA_w8
bu_SA:Lbu_SA_w9 bu_SA:Lbu_SA_w10 bu_SA:Lbu_S
> A_w11 bu_SA:Lbu_SA_w12 bu_SA:Lbu_SA_w13 bu_SA:Lbu_SA_w14
bu_SA:Lbu_SA_w15 bu_SA:m_healthprob bu_SA:m_bu_couple
>  bu_SA:m_bu_lparent bu_SA:m_bu_nkids bu_SA:m_bu_ageykidlt5
bu_SA:m_tenown bu_SA:m_reg_london bu_SA:m_urate bu_
> SA:bu_SA_1 bu_SA:_cons lnsig2u:_cons

. * -gllamm- results

. estimates use gllamm_35

. mat bg = e(b)

. local namesg: colfullnames bg

. di "`namesg'"
bu_SA:Lfemale bu_SA:Lage50m bu_SA:Lhealthprob bu_SA:Ledq_low
bu_SA:Ledq_high bu_SA:Ledqmiss bu_SA:Lbu_nkids bu_S
> A:Lbu_ageykidlt5 bu_SA:Lbu_lparent bu_SA:Lbu_couple bu_SA:Ltenown
bu_SA:Lreg_london bu_SA:Lurate bu_SA:w3 bu_S
> A:w4 bu_SA:w5 bu_SA:w6 bu_SA:w7 bu_SA:w8 bu_SA:w9 bu_SA:w10 bu_SA:w11
bu_SA:w12 bu_SA:w13 bu_SA:w14 bu_SA:w15 
> bu_SA:Lbu_SA bu_SA:Lbu_SA_female bu_SA:Lbu_SA_age50m
bu_SA:Lbu_SA_healthprob bu_SA:Lbu_SA_edq_low bu_SA:Lbu_SA
> _edq_high bu_SA:Lbu_SA_edqmiss bu_SA:Lbu_SA_bu_nkids
bu_SA:Lbu_SA_bu_ageykidlt5 bu_SA:Lbu_SA_bu_lparent bu_SA:
> Lbu_SA_bu_couple bu_SA:Lbu_SA_tenown bu_SA:Lbu_SA_reg_london
bu_SA:Lbu_SA_urate bu_SA:Lbu_SA_w3 bu_SA:Lbu_SA_w
> 4 bu_SA:Lbu_SA_w5 bu_SA:Lbu_SA_w6 bu_SA:Lbu_SA_w7 bu_SA:Lbu_SA_w8
bu_SA:Lbu_SA_w9 bu_SA:Lbu_SA_w10 bu_SA:Lbu_S
> A_w11 bu_SA:Lbu_SA_w12 bu_SA:Lbu_SA_w13 bu_SA:Lbu_SA_w14
bu_SA:Lbu_SA_w15 bu_SA:m_healthprob bu_SA:m_bu_couple
>  bu_SA:m_bu_lparent bu_SA:m_bu_nkids bu_SA:m_bu_ageykidlt5
bu_SA:m_tenown bu_SA:m_reg_london bu_SA:m_urate bu_
> SA:bu_SA_1 bu_SA:_cons pid1:_cons



Stephen
-------------------------------------
Professor Stephen P. Jenkins <s.jenkins@lse.ac.uk>
Department of Social Policy 
London School of Economics and Political Science
Houghton Street, London WC2A 2AE, U.K.
Tel: +44 (0)20 7955 6527
Changing Fortunes: Income Mobility and Poverty Dynamics in Britain, OUP
2011, http://ukcatalogue.oup.com/product/9780199226436.do
Survival Analysis using Stata:
http://www.iser.essex.ac.uk/survival-analysis  
Downloadable papers and software: http://ideas.repec.org/e/pje7.html 



Please access the attached hyperlink for an important electronic communications disclaimer: http://lse.ac.uk/emailDisclaimer

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index