Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: Choice of bw() in ivreg2


From   Luciano Borgoglio <[email protected]>
To   [email protected]
Subject   st: Choice of bw() in ivreg2
Date   Mon, 25 Apr 2011 14:43:32 -0300

Dear Statalisters:

How do I choose the bandwith (bw()) option in ivreg2?
There's evidence of autocorrelation in the disturbances of 17th order.
Then is 17 a good candidate?

Thank you all.

Luciano


2011/4/25, statalist-digest <[email protected]>:
> statalist-digest        Monday, April 25 2011        Volume 04 : Number 4133
>
>
>
> ** Send unsubscribe or help commands to [email protected]  **
>
> The digest contains:
>
>  Re: st: roll rates
>  st: How to maximize/minimize two equations in Stata
>  st: Re:Assigning Students Randomly to Classes of Heterogeneous Sizes
>  st: Problem with infix: record too long
>  Re: st: Problem with infix: record too long
>  Re: st: Problem with infix: record too long
>  Re: st: Problem with infix: record too long
>  Re: st: Problem with infix: record too long
>  st: Stata 11
>  Re: st: Problem with infix: record too long
>  Re: st: Problem with infix: record too long
>  Re: st: How to maximize/minimize two equations in Stata
>  Re: st: Problem with infix: record too long
>  st: String function headache.
>  Re: st: String function headache.
>  st: what does "no overidentifiying restriction" result mean for estat
> overid?
>
> ----------------------------------------------------------------------
>
> Date: Sun, 24 Apr 2011 13:46:51 -0400
> From: Argyn Kuketayev <[email protected]>
> Subject: Re: st: roll rates
>
> thanks, -xttrans- seems to be what I was looking for.
> i read that -fillin- command can help woth gaps.
>
>
>
> On Sat, Apr 23, 2011 at 8:48 AM, Austin Nichols <[email protected]>
> wrote:
>> Nick Cox <[email protected]>, Argyn Kuketayev
>> <[email protected]>:
>>
>> -xttrans- does not seem to respect gaps in time within panel, where
>> someone estimating transition probabilities would want to, but -tab-
>> works fine if you define the appropriate lag variable, and -svy:tab-
>> works better, if you have weighted and/or clustered data, or you want
>> to test something.
>>
>> clear
>> webuse nlswork
>> g lmsp=l.msp
>> la var lmsp "last month's state"
>> note lmsp: not last month, but actually year(s)
>> bys idcode (year): g flmsp=msp[_n-1]
>> la var flmsp "last observation's state"
>> xttrans msp
>> ta flmsp msp, nofr row
>> * note equivalence above--not period-to-period transitions:
>> ta lmsp msp, nofr row
>> svyset, srs
>> svy:ta lmsp msp, row
>> * usually transition matrix has cols sum to 1:
>> svy:ta msp lmsp, col
>> test _b[p12]=_b[p21]
>> test _b[p11]=_b[p22]
>> * the above tests equality of cell proportions...
>> * to test equality of transition rates use se or ci options:
>> svy:ta msp lmsp, col se
>> test _b[p12]=_b[p21]
>> test _b[p11]=_b[p22]
>>
>>
>> On Fri, Apr 22, 2011 at 7:58 PM, Nick Cox <[email protected]> wrote:
>>> . h xttrans
>>>
>>> On Sat, Apr 23, 2011 at 12:25 AM, Argyn Kuketayev
>>> <[email protected]> wrote:
>>>
>>>> i wonder if Stata has a package for pool roll rate analysis.
>>>> the roll rates are probabilities of transitions between asset's
>>>> states, such as credit grades. let's say, we have N assets, each can
>>>> be in one of the states S. some of these states are end-states, i.e.
>>>> once an asset gets into this state, it exits the pool.
>>>>
>>>> so we can observe monthly asset states, and transitions between them.
>>>> the assumptions is that all assets have the same state transition
>>>> probabilities, and that these probabilities remain constant over time
>>>> (stationary). i need to estimate the probabilities of transitions
>>>> between states. one can think of a matrix with rows corresponding to
>>>> an asset state this month, and the columns are states in next month.
>>>> so sum of columns in each row is 100%. each cell is a probability of
>>>> transition from row state to column state.
>>>>
>>>> what would be the most straightforward way to estimate the transition
>>>> probability matrix (roll rates) in Stata?
>> *
>> *   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/
>>
>
>
>
> - --
> Argyn Kuketayev
>
> *
> *   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/
>
> ------------------------------
>
> Date: Sun, 24 Apr 2011 15:03:56 -0300 (BRT)
> From: "Tiago V. Pereira" <[email protected]>
> Subject: st: How to maximize/minimize two equations in Stata
>
> Dear Statalisters,
>
> I need to solve a problem in Stata, but I am not sure if Stata is capable
> of solving that.
>
> I have checked -nl- and optimize in Mata, but I am not sure if they do
> what I am looking for.
>
>
> The problem I have is the following:
>
> (a*b+(1-a)*c)/((a^2)*d+((1-a)^2)*e+2*a*(1-a)*f) = X
>
> ((a^2)*d+((1-a)^2)*e+2*a*(1-a)*f)                     = Y
>
> I need to compute the single parameter "a" in both equations 1 and 2 that
> provides the largest value of X, while giving the smallest possible value
> of Y. I have all remaining values: b,c,d,e and f.
>
> I am asking you this question because I saw that both -nl- and optimize
> set each equation to a specific value. In my case, I don't know the value
> of X and Y. I am just interested in the largest possible value of X with
> the smallest possible value of Y.
>
>
>  I will be very grateful if you could provide me some advice/references.
>
> All the best,
>
> Tiago
>
>
>
>
>
>
>
> *
> *   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/
>
> ------------------------------
>
> Date: Sun, 24 Apr 2011 12:29:34 -0600
> From: Mike Lacy <[email protected]>
> Subject: st: Re:Assigning Students Randomly to Classes of Heterogeneous
> Sizes
>
> Andy Baxter <[email protected]> wrote:
>
>  >I am using Stata 11 on a dataset of students and their class
>  >assignments that is structured like this:
>  >
>  >_studentid  _year _school _grade _classid
>  >
>  >Now, I want to randomly assign the students to classes--within the
>  >same year, school, and grade--while keeping the existing class sizes
>  >the same.
>  >
>  >I would be grateful for any code that would accomplish this.
>  >
>  >Thanks,
>  >
>
> If I understand the question correctly, this can be accomplished by
> permuting the class listings
> within year, school, and grade, and merging them back onto the original
> data.
>
> // example data
> clear
> set obs 60
> gen int id = _n
> gen byte year = 1 + int(2 * runiform())
> gen byte school = 1 + int(2 * runiform())
> gen byte grade = 1 + int(3 * runiform())
> gen byte class = 1 + int(5 * runiform())
> //
> //  A little program to save the data that saves the data that
> - -permute- feeds it.
> cap prog drop saveit
> prog saveit, rclass
>    args file
>    keep id class
>    rename class newclass
>    save `file', replace
>    return scalar something = -1  // permute wants something
> end
> //
> tempfile temp
> permute class r(something), reps(1) strata(year school grade): saveit `temp'
> merge 1:1 id using `temp'
> // eyeball to check
> sort year school grade
> edit
>
> Regards,
>
> =-=-=-=-=-=-=-=-=-=-=-=-=
> Mike Lacy, Assoc. Prof.
> Soc. Dept., Colo. State. Univ.
> Fort Collins CO 80523 USA
> (970)-491-6721
>
>
> *
> *   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/
>
> ------------------------------
>
> Date: Sun, 24 Apr 2011 15:42:02 -0300
> From: =?ISO-8859-1?Q?Barbara_Guimar=E3es?= <[email protected]>
> Subject: st: Problem with infix: record too long
>
> Dear statlisters,
>
> I'm having trouble reading data with infix. I am using Stata 11.1 for
> Windows.
>
> I received the "record too long" error, and I subsequently read the
> thread "Re:st:reading data with infix: record too long" (as of 2003
> and 2008), then checked my data set with -hexdump, analyze- but I
> don't know what to do now.
>
> The number of lines in my dataset is 3,972,429, but Stata is only
> reading 2,513,116 lines. I have also tried to open the dataset using a
> text editor to see if I could do something about it (my data set
> format is .TXT), but its not opening due to its size.
> I have alos tested reading the dataset wiht only one or two variables,
> but in all cases Stata only brings part of the sata set and I receive
> the "record too long" error.
>
> I do believe it is not a memory issue, because I had previously read
> another dataset in Stata, which was as large as this one, with no
> problems. The dataset I'm having trouble with reading is in Binary
> format, and I don't know if this is the cause of the error or not (the
> other dataset is ASCII format).
>
> What are the possibilities, if any, to integraly read this file in
> Stata? I would need to merge both datasets afterwards, would it be
> possible?
>
> Thanks and regards,
>
> Barbara
> *
> *   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/
>
> ------------------------------
>
> Date: Sun, 24 Apr 2011 19:45:35 +0100
> From: Nick Cox <[email protected]>
> Subject: Re: st: Problem with infix: record too long
>
> 2011/4/24 Barbara Guimarães <[email protected]>:
>> Dear statlisters,
>>
>> I'm having trouble reading data with infix. I am using Stata 11.1 for
>> Windows.
>>
>> I received the "record too long" error, and I subsequently read the
>> thread "Re:st:reading data with infix: record too long" (as of 2003
>> and 2008), then checked my data set with -hexdump, analyze- but I
>> don't know what to do now.
>>
>> The number of lines in my dataset is 3,972,429, but Stata is only
>> reading 2,513,116 lines. I have also tried to open the dataset using a
>> text editor to see if I could do something about it (my data set
>> format is .TXT), but its not opening due to its size.
>> I have alos tested reading the dataset wiht only one or two variables,
>> but in all cases Stata only brings part of the sata set and I receive
>> the "record too long" error.
>>
>> I do believe it is not a memory issue, because I had previously read
>> another dataset in Stata, which was as large as this one, with no
>> problems. The dataset I'm having trouble with reading is in Binary
>> format, and I don't know if this is the cause of the error or not (the
>> other dataset is ASCII format).
>>
>> What are the possibilities, if any, to integraly read this file in
>> Stata? I would need to merge both datasets afterwards, would it be
>> possible?
>>
>> Thanks and regards,
>>
>> Barbara
>> *
>> *   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/
>>
>
> *
> *   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/
>
> ------------------------------
>
> Date: Sun, 24 Apr 2011 19:52:24 +0100
> From: Nick Cox <[email protected]>
> Subject: Re: st: Problem with infix: record too long
>
> - -infix- cannot read binary files.
>
> .txt is just a file extension that is commonly assigned to ASCII
> files; if the file is binary, calling it .txt won't make it so.
>
> Showing us the first few lines of the file might give us a clue.
>
> Nick
>
>> 2011/4/24 Barbara Guimarães <[email protected]>:
>>
>>> I'm having trouble reading data with infix. I am using Stata 11.1 for
>>> Windows.
>>>
>>> I received the "record too long" error, and I subsequently read the
>>> thread "Re:st:reading data with infix: record too long" (as of 2003
>>> and 2008), then checked my data set with -hexdump, analyze- but I
>>> don't know what to do now.
>>>
>>> The number of lines in my dataset is 3,972,429, but Stata is only
>>> reading 2,513,116 lines. I have also tried to open the dataset using a
>>> text editor to see if I could do something about it (my data set
>>> format is .TXT), but its not opening due to its size.
>>> I have alos tested reading the dataset wiht only one or two variables,
>>> but in all cases Stata only brings part of the sata set and I receive
>>> the "record too long" error.
>>>
>>> I do believe it is not a memory issue, because I had previously read
>>> another dataset in Stata, which was as large as this one, with no
>>> problems. The dataset I'm having trouble with reading is in Binary
>>> format, and I don't know if this is the cause of the error or not (the
>>> other dataset is ASCII format).
>>>
>>> What are the possibilities, if any, to integraly read this file in
>>> Stata? I would need to merge both datasets afterwards, would it be
>>> possible?
>
> *
> *   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/
>
> ------------------------------
>
> Date: Sun, 24 Apr 2011 16:24:29 -0300
> From: =?ISO-8859-1?Q?Barbara_Guimar=E3es?= <[email protected]>
> Subject: Re: st: Problem with infix: record too long
>
> Dear Nick, unfortunetly, I'm not being able to open the file with any
> word processor (I believe that it is because of its size / this
> dataset was provided by an government organization, so I already
> received it in .txt format and don't have access to the primary data)
>
>
> However, the output of the hexdump analyze was:
>
>
>>> . hexdump TS_QUEST_ALUNO.txt, analyze
>
>
>   Line-end characters                                           Line
> length (tab=1)
>
>     \r\n         (Windows)               2,517,361
> minimum                        0
>
>     \r by itself (Mac)                        686,626
> maximum               20,971,542
>
>     \n by itself (Unix)                      768,441
>
>   Space/separator characters                               Number of
> lines           3,972,429
>
>     [blank]                                112,067,613
>   EOL at EOF?                  no
>
>     [tab]                                          707,187
>
>     [comma] (,)                               765,547           Length
> of first 5 lines
>
>   Control characters
>    Line 1                       120
>
>     binary 0                               30,611,037
>   Line 2                       120
>
>     CTL excl. \r, \n, \t                 19,330,367
> Line 3                       120
>
>     DEL                                          367,820
>      Line 4                       120
>
>     Extended (128-159,255)     21,370,596                    Line 5
>                    120
>
>   ASCII printable
>
>     A-Z                                    149,642,323
>
>     a-z                                       16,234,081
> File format                 BINARY
>
>     0-9                                       53,967,247
>
>     Special (!@#$ etc.)              28,963,365
>
>     Extended (160-254)             54,882,559
>
>                           ---------------
>
>   Total                                    495,399,531
>
>
>
>   Observed were:
>
>      \0 ^A ^B ^C ^D ^E ^F ^G ^H \t \n ^K ^L \r ^N ^O ^P ^Q ^R ^S ^T ^U ^V ^W
>
>      ^X ^Y ^Z Esc 28 29 30 31 blank ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4
> 5
>
>      6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y
>
>      Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | }
>
>      ~ DEL 128 E^A E^B E^C E^D E^E E^F E^G E^H E^I E^J E^K E^L E^M E^N E^O
>
>      E^P E^Q E^R E^S E^T E^U E^V E^W E^X E^Y E^Z 155 156 157 158 159 160 ¡ ¢
>
>      £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ
>
>      Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê
>
>      ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ 255
>
>
> Is there any way I could transform this dataset in a way Stata would
> read it entirely?
>
>
>
> thank you
>
> *
> *   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/
>
> ------------------------------
>
> Date: Sun, 24 Apr 2011 16:26:35 -0300
> From: =?ISO-8859-1?Q?Barbara_Guimar=E3es?= <[email protected]>
> Subject: Re: st: Problem with infix: record too long
>
> Dear Nick, unfortunetly, I'm not being able to open the file with any
> word processor (I believe that it is because of its size / this
> dataset was provided by an government organization, so I already
> received it in .txt format and don't have access to the primary data)
>
>
> However, the output of the hexdump analyze was:
>
>>> . hexdump TS_QUEST_ALUNO.txt, analyze
>
>
>
>   Line-end characters                                           Line
> length (tab=1)
>
>     \r\n         (Windows)               2,517,361
> minimum                        0
>
>     \r by itself (Mac)                        686,626
> maximum               20,971,542
>
>     \n by itself (Unix)                      768,441
>
>   Space/separator characters                               Number of
> lines           3,972,429
>
>     [blank]                                112,067,613
>   EOL at EOF?                  no
>
>     [tab]                                          707,187
>
>     [comma] (,)                               765,547           Length
> of first 5 lines
>
>   Control characters
>    Line 1                       120
>
>     binary 0                               30,611,037
>   Line 2                       120
>
>     CTL excl. \r, \n, \t                 19,330,367
> Line 3                       120
>
>     DEL                                          367,820
>      Line 4                       120
>
>     Extended (128-159,255)     21,370,596                    Line 5
>                    120
>
>   ASCII printable
>
>     A-Z                                    149,642,323
>
>     a-z                                       16,234,081
> File format                 BINARY
>
>     0-9                                       53,967,247
>
>     Special (!@#$ etc.)              28,963,365
>
>     Extended (160-254)             54,882,559
>
>                           ---------------
>
>   Total                                    495,399,531
>
>
>
>   Observed were:
>
>      \0 ^A ^B ^C ^D ^E ^F ^G ^H \t \n ^K ^L \r ^N ^O ^P ^Q ^R ^S ^T ^U ^V ^W
>
>      ^X ^Y ^Z Esc 28 29 30 31 blank ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4
> 5
>
>      6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y
>
>      Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | }
>
>      ~ DEL 128 E^A E^B E^C E^D E^E E^F E^G E^H E^I E^J E^K E^L E^M E^N E^O
>
>      E^P E^Q E^R E^S E^T E^U E^V E^W E^X E^Y E^Z 155 156 157 158 159 160 ¡ ¢
>
>      £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ
>
>      Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê
>
>      ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ 255
>
> Thank you
>
> Rgds,
> Barbara
>
> *
> *   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/
>
> ------------------------------
>
> Date: Sun, 24 Apr 2011 16:52:16 -0300
> From: =?ISO-8859-1?Q?Barbara_Guimar=E3es?= <[email protected]>
> Subject: st: Stata 11
>
> *
> *   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/
>
> ------------------------------
>
> Date: Sun, 24 Apr 2011 17:36:14 -0300
> From: =?ISO-8859-1?Q?Barbara_Guimar=E3es?= <[email protected]>
> Subject: Re: st: Problem with infix: record too long
>
> Dear Nick, unfortunetly, I'm not being able to open the file with any
> word processor (I believe that it is because of its size / this
> dataset was provided by an government organization, so I already
> received it in .txt format and don't have access to the primary data)
>
> However, the output of the hexdump analyze was:
>
>>> hexdump TS_QUEST_ALUNO.txt, analyze
>
>   Line-end characters
> Line length (tab=1)
>     \r\n        (Windows)                     2,517,361
> minimum                        0
>     \r by itself (Mac)                             686,626
>    maximum               20,971,542
>     \n by itself (Unix)                            768,441
>
>   Space/separator characters                                  Number
> of lines                3,972,429
>     [blank]                                      112,067,613
>   EOL at EOF?                         no
>     [tab]                                                707,187
>     [comma] (,)                                     765,547
>  Length of first 5 lines
>
>   Control characters
>      Line1                       120
>     binary 0                                     30,611,037
>     Line2                       120
>     CTL excl. \r, \n, \t                      19,330,367
> Line 3                       120
>     DEL                                               367,820
>       Line 4                       120
>     Extended (128-159,255)          21,370,596                Line 5
>                     120
>
>   ASCII printable
>     A-Z                                         149,642,323
>     a-z                                            16,234,081
>      File format                 BINARY
>     0-9                                            53,967,247
>     Special (!@#$ etc.)                  28,963,365
>     Extended (160-254)                 54,882,559
>                           ---------------
>   Total                                         495,399,531
>
>
>   Observed were:
>      \0 ^A ^B ^C ^D^E ^F ^G ^H \t \n ^K ^L \r ^N ^O ^P ^Q ^R ^S ^T ^U ^V ^W
>      ^X ^Y ^Z Esc28 29 30 31 blank ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5
>      6 7 8 9 : ;< = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y
>      Z [ \ ] ^ _ `a b c d e f g h i j k l m n o p q r s t u v w x y z { | }
>      ~ DEL 128 E^AE^B E^C E^D E^E E^F E^G E^H E^I E^J E^K E^L E^M E^N E^O
>      E^P E^Q E^RE^S E^T E^U E^V E^W E^X E^Y E^Z 155 156 157 158 159 160 ¡ ¢
>      £ ¤ ¥ ¦ § ¨ ©ª « ¬ ­ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ
>      Ç È É Ê Ë Ì ÍÎ Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê
>      ë ì í î ï ð ñò ó ô õ ö ÷ ø ù ú û ü ý þ 255
>
> Is there any way I could transform this dataset in a way Stata would
> read it entirely?
>
>  thank you
>
> Barbara
>
>
> - -infix- cannot read binary files.
>
> .txt is just a file extension that is commonly assigned to ASCII
> files; if the file is binary, calling it .txt won't make it so.
>
> Showing us the first few lines of the file might give us a clue.
>
> Nick
>
>
>> 2011/4/24 Barbara Guimarães <[email protected]>:
>>
>
>
>>> I'm having trouble reading data with infix. I am using Stata 11.1 for
>>> Windows.
>>>
>>> I received the "record too long" error, and I subsequently read the
>>> thread "Re:st:reading data with infix: record too long" (as of 2003
>>> and 2008), then checked my data set with -hexdump, analyze- but I
>>> don't know what to do now.
>>>
>>> The number of lines in my dataset is 3,972,429, but Stata is only
>>> reading 2,513,116 lines. I have also tried to open the dataset using a
>>> text editor to see if I could do something about it (my data set
>>> format is .TXT), but its not opening due to its size.
>>> I have alos tested reading the dataset wiht only one or two variables,
>>> but in all cases Stata only brings part of the sata set and I receive
>>> the "record too long" error.
>>>
>>> I do believe it is not a memory issue, because I had previously read
>>> another dataset in Stata, which was as large as this one, with no
>>> problems. The dataset I'm having trouble with reading is in Binary
>>> format, and I don't know if this is the cause of the error or not (the
>>> other dataset is ASCII format).
>>>
>>> What are the possibilities, if any, to integraly read this file in
>>> Stata? I would need to merge both datasets afterwards, would it be
>>> possible?
>
> *
> *   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/
>
> ------------------------------
>
> Date: Sun, 24 Apr 2011 17:54:24 -0300
> From: =?ISO-8859-1?Q?Barbara_Guimar=E3es?= <[email protected]>
> Subject: Re: st: Problem with infix: record too long
>
> Dear Nick, unfortunetly, I'm not being able to open the file with any
> word processor (I believe that it is because of its size / this
> dataset was provided by an government organization, so I already
> received it in .txt format and don't have access to the primary data)
>
> However, the output of the hexdump analyze was:
>>> . hexdump TS_QUEST_ALUNO.txt, analyze
>
> Line-end characters                                          Line lenght
> (tab=1)
>    \r\n    (Windows)                      2,517,361           minimum
>                         0
>    \r by itself (Mac)                          686,626
> maximum               20,971,542
>    \n by itself (Unix)                         768,441
>
> Space/separator characters                               Number of
> lines            3,972,429
>     [blank]                                  112,067,613           EOL
> at EOF?               no
>     [tab]                                             707,187
>     [comma] (,)                                  765,547      Length
> of first 5 lines
>
> Control characters
> Line 1                            120
>     binary 0                               30,611,037
> Line 2                            120
>     CTL excl. \r, \n, \t                 19,330,367              Line
> 3                            120
>     DEL                                           367,820
> Line 4                            120
>     Extended (128-159,255)      21,370,596              Line5
>                     120
> ASCII printable
>      A-Z                                    149,642,323
>      a-z                                       16,234,081
> File format      BINARY
>      0-9                                        53,967,247
>      Special (!@#$ etc.)               28,963,365
>     Extended (160-254)               54,882,559
>                       ------------------
> Total                                        495,399,531
>
> Observed were:
> \0^A^B^C^D^E^F^G^H\t\n^K^L\r ^N^O^P^Q^R^S^T^U^V^W
> ^X^Y^Z Esc 28 29 30 31 blank ! " # $ % & ' () * +, -./ 0 1 2 3 4 5
> 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y
> Z [\]
>
> Is there any way I could transform this dataset in a way Stata would
> read it entirely?
>
> thank you and regards,
> Barbara
> *
> *   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/
>
> ------------------------------
>
> Date: Sun, 24 Apr 2011 23:02:08 +0100
> From: Mauricio Esteban Cuak <[email protected]>
> Subject: Re: st: How to maximize/minimize two equations in Stata
>
> Hi Tiago,
>
> I am by no means an expert in optimisation, but you seem to have an
> ill-defined problem, since you're trying to optimise with two
> objectives in mind.
> You could try separately maximising X and minimising Y and checking if
> you get the same a.
> Otherwise, you need to put some weights on the two objectives.
> Say, you could maximize:
>
> t*X - k*Y
> Where t and k can be 1 of course.
>
> Best,
>
> M
>
> 2011/4/24 Tiago V. Pereira <[email protected]>:
>> Dear Statalisters,
>>
>> I need to solve a problem in Stata, but I am not sure if Stata is capable
>> of solving that.
>>
>> I have checked -nl- and optimize in Mata, but I am not sure if they do
>> what I am looking for.
>>
>>
>> The problem I have is the following:
>>
>> (a*b+(1-a)*c)/((a^2)*d+((1-a)^2)*e+2*a*(1-a)*f) = X
>>
>> ((a^2)*d+((1-a)^2)*e+2*a*(1-a)*f)                     = Y
>>
>> I need to compute the single parameter "a" in both equations 1 and 2 that
>> provides the largest value of X, while giving the smallest possible value
>> of Y. I have all remaining values: b,c,d,e and f.
>>
>> I am asking you this question because I saw that both -nl- and optimize
>> set each equation to a specific value. In my case, I don't know the value
>> of X and Y. I am just interested in the largest possible value of X with
>> the smallest possible value of Y.
>>
>>
>>  I will be very grateful if you could provide me some advice/references.
>>
>> All the best,
>>
>> Tiago
>>
>>
>>
>>
>>
>>
>>
>> *
>> *   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/
>>
>
> *
> *   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/
>
> ------------------------------
>
> Date: Mon, 25 Apr 2011 01:41:09 +0100
> From: Nick Cox <[email protected]>
> Subject: Re: st: Problem with infix: record too long
>
> Your last question is, in effect, can I explain to you how to read a
> binary file with unspecified structure into Stata, and the short
> answer is sorry, no.
>
> It's a rare word processor that can open large binary files with
> success. Word processors accept a range of formats for documents,
> tending to prefer their own proprietary format, but are usually
> useless at reading binary data files. A good text editor could do it;
> that does not include the proprietary editors bundled with MS Windows.
>
> I wonder if you are being misled by the first line in the help for
> - -infix- below, while overlooking the second line, which is vital.
>
> "infix reads into memory from a disk dataset that is not in Stata
> format.  infix requires
>     that the data be in fixed-column format."
>
> As you reported, Stata is seeing far fewer end-of-line character pairs
> \r\n than lines in this file, \r and \n characters are occurring by
> themselves, which is not standard for text files in MS Windows, and
> - -hexdump- is labelling this binary. It' s unlikely to be wrong on
> that.
>
> You could try just
>
> . type filename.txt
>
> in Stata and that might show you, and us, the first few lines of the
> file. They might be recognisable to someone as in a particular format.
>
> I think if you can't get an idea of what the structure of this file
> is, then you have no way to read it into Stata. Why a "government
> organisation" is providing a binary file and calling a .txt I cannot
> explain. You may need to talk to them.
>
> Nick
>
> 2011/4/24 Barbara Guimarães <[email protected]>:
>> Dear Nick, unfortunetly, I'm not being able to open the file with any
>> word processor (I believe that it is because of its size / this
>> dataset was provided by an government organization, so I already
>> received it in .txt format and don't have access to the primary data)
>>
>>
>> However, the output of the hexdump analyze was:
>>
>>
>>>> . hexdump TS_QUEST_ALUNO.txt, analyze
>>
>>
>>  Line-end characters                                           Line
>> length (tab=1)
>>
>>    \r\n         (Windows)               2,517,361
>> minimum                        0
>>
>>    \r by itself (Mac)                        686,626
>> maximum               20,971,542
>>
>>    \n by itself (Unix)                      768,441
>>
>>  Space/separator characters                               Number of
>> lines           3,972,429
>>
>>    [blank]                                112,067,613
>>  EOL at EOF?                  no
>>
>>    [tab]                                          707,187
>>
>>    [comma] (,)                               765,547           Length
>> of first 5 lines
>>
>>  Control characters
>>   Line 1                       120
>>
>>    binary 0                               30,611,037
>>  Line 2                       120
>>
>>    CTL excl. \r, \n, \t                 19,330,367
>> Line 3                       120
>>
>>    DEL                                          367,820
>>     Line 4                       120
>>
>>    Extended (128-159,255)     21,370,596                    Line 5
>>                   120
>>
>>  ASCII printable
>>
>>    A-Z                                    149,642,323
>>
>>    a-z                                       16,234,081
>> File format                 BINARY
>>
>>    0-9                                       53,967,247
>>
>>    Special (!@#$ etc.)              28,963,365
>>
>>    Extended (160-254)             54,882,559
>>
>>                          ---------------
>>
>>  Total                                    495,399,531
>>
>>
>>
>>  Observed were:
>>
>>     \0 ^A ^B ^C ^D ^E ^F ^G ^H \t \n ^K ^L \r ^N ^O ^P ^Q ^R ^S ^T ^U ^V
>> ^W
>>
>>     ^X ^Y ^Z Esc 28 29 30 31 blank ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4
>> 5
>>
>>     6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X
>> Y
>>
>>     Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { |
>> }
>>
>>     ~ DEL 128 E^A E^B E^C E^D E^E E^F E^G E^H E^I E^J E^K E^L E^M E^N E^O
>>
>>     E^P E^Q E^R E^S E^T E^U E^V E^W E^X E^Y E^Z 155 156 157 158 159 160 ¡
>> ¢
>>
>>     £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å
>> Æ
>>
>>     Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é
>> ê
>>
>>     ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ 255
>>
>>
>> Is there any way I could transform this dataset in a way Stata would
>> read it entirely?
>>
>
> *
> *   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/
>
> ------------------------------
>
> Date: Sun, 24 Apr 2011 23:45:28 -0400
> From: Scott Talkington <[email protected]>
> Subject: st: String function headache.
>
> I just can't seem to make this work.  What I want to do is search for
> any occurrence of the "#" character in a string variable and set a flag
> for that observation.  I'm searching 6 different strings labeled
> something like mystring1 mystring2 etc. and the flags are mynumber1
> mynumber2 etc..
>
> So my do file:
>
> forvalues x=1/6 {
> foreach y in # {
> replace mynumber `x'= strmatch(mistring`x', "`y'")
> }
> }
>
> I just listed one character in the y list above, but in reality I'm not
> having a problem with normal strings like "APT" but with wildcards and
> with the number sign character itself.
>
> I assumed that placing a "?" character iyn the search string (s2) would
> match zero or one characters + the "#" but it seems to be matching all
> strings with one character that are either a  number  or a letter.  Huh?
>
> If I include the wildcard (either the asterisk or the question mark)
> *anywhere* (either in the "foreach" part of the do file or in the
> "replace" command) it just doesn't work the way I expect it to.  There's
> a difference between what I get depending on how many quotes I use  and
> where as well, but I'm just not getting anything that does what I want
> it to.  I've even tried using the backslash character to indicate that I
> don't want the "#" to be read as an operator, but I'm not even sure
> where to put the backslash or how to arrange the quotation marks.  It's
> driving me nuts.  There's some rule here that I'm just not getting.
>
> - --Scott
> *
> *   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/
>
> ------------------------------
>
> Date: Sun, 24 Apr 2011 23:54:32 -0400
> From: Scott Talkington <[email protected]>
> Subject: Re: st: String function headache.
>
> OK, this seemed to work.  But I'm not sure... why. :-)
>
> forvalues x=1/6 {
> foreach y in # {
> replace mynumber`x'=strmatch(mystring`x',"*`y'*")
> }
> }
>
> On 4/24/2011 11:45 PM, Scott Talkington wrote:
>> I just can't seem to make this work.  What I want to do is search for
>> any occurrence of the "#" character in a string variable and set a
>> flag for that observation.  I'm searching 6 different strings labeled
>> something like mystring1 mystring2 etc. and the flags are mynumber1
>> mynumber2 etc..
>>
>> So my do file:
>>
>> forvalues x=1/6 {
>> foreach y in # {
>> replace mynumber `x'= strmatch(mistring`x', "`y'")
>> }
>> }
>>
>> I just listed one character in the y list above, but in reality I'm
>> not having a problem with normal strings like "APT" but with wildcards
>> and with the number sign character itself.
>>
>> I assumed that placing a "?" character iyn the search string (s2)
>> would match zero or one characters + the "#" but it seems to be
>> matching all strings with one character that are either a  number  or
>> a letter.  Huh?
>>
>> If I include the wildcard (either the asterisk or the question mark)
>> *anywhere* (either in the "foreach" part of the do file or in the
>> "replace" command) it just doesn't work the way I expect it to.
>> There's a difference between what I get depending on how many quotes I
>> use  and where as well, but I'm just not getting anything that does
>> what I want it to.  I've even tried using the backslash character to
>> indicate that I don't want the "#" to be read as an operator, but I'm
>> not even sure where to put the backslash or how to arrange the
>> quotation marks.  It's driving me nuts.  There's some rule here that
>> I'm just not getting.
>>
>> --Scott
>> *
>> *   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/
> *
> *   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/
>
> ------------------------------
>
> Date: Sun, 24 Apr 2011 20:55:27 -0700
> From: yuanxi zhang <[email protected]>
> Subject: st: what does "no overidentifiying restriction" result mean for
> estat overid?
>
> Hello,
>
> I was doing instrumental variable regression on stata, and tried estat
> overid command to test whether the instrument is exogenous. However,
> the program shows "no overidentifying restriction", which looks like
> an error message to me. Does that mean we should reject the null or
> the other way around?
>
> Thank you very much!
>
> Brandon Zhang
> *
> *   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/
>
> ------------------------------
>
> End of statalist-digest V4 #4133
> ********************************
>
> *
> *   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/
>

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index