Conformability Error Mata
Contents |
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: st: 3200 conformability error when writing to stata variable from mata From Nick Cox
Stata 3200 Conformability Error
Conformability Error Stata Matrix
would be that Mata put this vector in the first 20 observations. Or again, into the last 20 observations. However, defaults such as those are not part of the Mata- Stata game. You need to be explicit about which observations are to receive the values in this vector. Nick On 14 Sep 2012, at 05:38, Aaron Kirkman
Stata Mata
of code that replicates a -generate- statement (as an example) to write a new variable to an existing dataset. Under certain circumstances, however, the code throws a runtime error: st_store(): 3200 conformability error many ways to R, Matlab or GAUSS. It does have some unique and intriguing features however. One is that it is a compiled language rather than interpreted, which improves performance. It also has been parallelized in Stata/MP (available on all the SSCC Linux servers and Condor) which dramatically improves performance. On the other hand Mata is fairly new and has not yet "caught on" at the SSCC, so we don't have any real-world comparisons to offer. Mata is not a replacement for Stata, nor is it intended to be a stand-alone statistical package. It is a tool which is best used as a supplement to Stata (or SAS or SPSS), for doing those things Stata does not do well on its own. In particular, Mata does not work in the context of a single data set, http://www.stata.com/statalist/archive/2012-09/msg00523.html giving it additional flexibility. But you should not try to learn Mata unless you are already familiar with Stata or another statistical package. Mata is a relatively "low level" language. Much of your time in Stata (or SAS or SPSS) is spent using built-in programs, finding just the right combination of options to get Stata to do what you want. In Mata you will take direct control, telling Mata what you want to do step-by-step. (The Mata optimizer, which we will discuss at length, https://www.ssc.wisc.edu/sscc/pubs/4-26.htm is a notable exception.) That means doing simple things is usually more cumbersome in Mata than in Stata, but Mata has fewer constraints. This article is primarily written for people who have significant experience using Stata, SAS or SPSS syntax, but no other programming languages. Thus there will be a lot of emphasis on learning how to do useful things by manipulating matrices, and many of the examples are designed to give experience doing so as well as illustrating a particular concept. Matlab and GAUSS veterans may find they can skim these sections, focusing on what is new to them. C programmers will find that Mata imitates C whenever it can, so they can probably skim the sections on standard programming constructs like loops. But no matter what your background, you will learn far more if you read this article at the computer, with Stata running, and actually type in the examples. Mata runs within Stata, so in order to use Mata you'll need to know how to run a Stata program, called a do file. If you've never used Stata, please read the section on do files in An Introduction to Stata. Interactive Stata (i.e. start it up and type in commands) is a great way to learn and that's how you'll do the examples in this article. But for real work you'll want to write everything in do files. There are several example files associated with this article. There are links to them in the text as they are use here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta http://stackoverflow.com/questions/30075445/post-eb-vector-from-a-custom-program-in-stata Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping conformability error each other. Join them; it only takes a minute: Sign up Post e(b) vector from a custom program in Stata up vote 3 down vote favorite I wrote a program that computes a weighted regression and now I want my estimation results to be stored as an e(b) vector so that the bootstrap command can easily access conformability error stata the results, but I keep getting an error. My program looks like: capture program drop mytest program mytest, eclass version 13 syntax varlist [if] marksample touse // mata subroutine creates matrix `b', such as mata: bla("`varlist'", "`touse'") tempname b matrix `b' = (1\2\3) ereturn post `b' end mytest town_id ereturn list But I keep getting a conformability error r(503); upon running the script. When I instead post an ordinary matrix such as ereturn matrix x = b, everything works fine but I would like to have my coefficients stored 'properly' in an e(b) vector. I checked Stata's documentation but was unable to find out why this is not working. Their advice is to code tempname b V // produce coefficient vector `b' and variance–covariance matrix `V' ereturn post `b' `V', obs(`nobs') depname(`depn') esample(`touse') The options of ereturn post are all optional. Could anyone tell me what I am missing here? Thanks! stata share|improve this question asked May 6 '15 at 11:30 Robert Aue 183 add a comment| 1 Answer 1 a