Home > conformability error > conformability error stata matrix

Conformability Error Stata Matrix

Contents

st: Conformability error in creating matrix while cross-tabulating data Date Thu, 5 Jul 2007 11:05:14 -0400 Dear Statalist, I am trying to get the frequency of certain variables and put it in a matrix (see stata conformability error r(503) code below). I need to cross tabulate each variable q271-q277 with each

Conformability Error Stata Factor

variable q256-q260. I then need to add the frequencies of q256-q258 as one group and q259-q260 as the other stata conformability error 503 group. Finally, I want to create a 7 x 2 matrix of the results (q271-q277 will be the 7 rows; and q256-q258 & q259-q260 will be the 2 columns). I ran

Conformability Error Mata

the following code, but am getting "conformability error". I think the problem is that I want a 7 x 2 matrix, but I'm using i = 271/277 rather than i=1/7. If this is the case, can you suggest an alternative? P.S. - Right now, I have variables q1-q7. I tried to drop them and rename q271-q277 as q1-q7 (in case this was stata display matrix the issue), without much luck. Thanks, Hugh matrix results = J(7,2,.); forval i = 271/277 {; count if q`i'~=. & q256~=.; local a = r(N); count if q`i'~=. & q257~=.; local a = `a' + r(N); count if q`i'~=. & q258~=.; matrix results[`i',1] = `a' + r(N); count if q`i'~=. & q259~=.; local b = r(N); count if q`i'~=. & q260~=.; matrix results[`i',2] = `b' + r(N); }; matrix colnames results = NP FP; matrix rownames results = q271 q272 q273 q274 q275 q276 q277; matrix li results, noheader; * * For searches and help try: * http://www.stata.com/support/faqs/res/findit.html * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ Follow-Ups: st: RE: Conformability error in creating matrix while cross-tabulating data From: "Nick Cox" Prev by Date: Re: st: Forvalues, syntax error Next by Date: Re: st: rotated components in pca, order of Previous by thread: st: do-file editor - difference between Stata 9 and 10 Next by thread: st: RE: Conformability error in creating matrix while cross-tabulating data Index(es): Date Thread © Copyright 1996–2016 StataCorp LP | Terms of use | Privacy | Contact us | What's new | Site index

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: st: mata conformability error, but matrices are conformable From Misha Spisok To statalist@hsphsun2.harvard.edu Subject Re: st: mata conformability error, but matrices are

Matrix Stata

conformable Date Sat, 8 May 2010 15:09:14 -0700 Thank you, Professor Buis! This works

Stata Mata

(of course), but I have a further question about forcing a `noconstant' in the regression (I think I'll need e(b) to exclude a constant if my sketch continues as imagined). I have tried a number of things, but I cannot get it to work the way I'd like it to work. For example (same code with one change at regression http://www.stata.com/statalist/archive/2007-07/msg00165.html -poisson-, though I have the same problem with -regress-), program calcp, rclass version 10.1 syntax varlist [if] [in] marksample touse gettoken lhs rhs : varlist poisson `lhs' `rhs' if `touse', noconstant /* CHANGED: to try to force it to omit a constant */ mata: makexb("`rhs'", "`touse'") end mata: void makexb(string scalar rhs, string scalar touse) { real matrix X real rowvector b real colvector Xb real scalar idx X = st_data(., tokens(rhs), touse) X = http://www.stata.com/statalist/archive/2010-05/msg00412.html X, J(rows(X), 1, 1) b = st_matrix("e(b)") Xb = X*b' idx = st_addvar("float", "Xb") st_store(., idx, touse, Xb) } end I also tried changing the -syntax- line by including a non-optional noconstant option: , noconstant. When I try the above code, I get no constant (as desired), but I get this error: *: 3200 conformability error makexb(): - function returned error : - function returned error r(3200); If I make the following changes: syntax varlist [if] [in] [,noCONStant] poisson `lhs' `rhs' if `touse', `noconstant' then I get a constant _and_ the same error. If, instead, I make the following changes: syntax varlist [if] [in] , noCONStant poisson `lhs' `rhs' if `touse', `noconstant' I, again, get a constant _and_ the same error. Example for error: sysuse auto, clear local xlist mpg-length calcp price `xlist', noconstant Thank you again. Yours, Misha On Sat, May 8, 2010 at 1:59 AM, Maarten buis wrote: > --- On Sat, 8/5/10, Misha Spisok wrote: >> > I am getting the following error due to some code I >> > have written (given below with complete, but short, >> > working example to reproduce the error): > > --- On Sat, 8/5/10, Maarten buis wrote: >> The changed code below works: > > My earlier code, as well as the original code, > ignored the selection of observations

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. https://www.ssc.wisc.edu/sscc/pubs/4-26.htm 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 conformability error single data set, 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 conformability error stata will discuss at length, 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

be down. Please try the request again. Your cache administrator is webmaster. Generated Wed, 05 Oct 2016 05:21:29 GMT by s_hv987 (squid/3.5.20)

 

Related content

3200 conformability error

Conformability Error table id toc tbody tr td div id toctitle Contents div ul li a href Matsize a li li a href Conformability Error In Stata a li li a href Stata Conformability Error R a li ul td tr tbody table p 'Login or Register' at the top-right of this page relatedl For more information on Statalist see the FAQ oaxaca decomp conformability error Announcement Collapse No announcement yet X Collapse Posts Latest Activity Search Page khb deriv conformability error of Filter Time All Time Today Last Week Last Month Show All Discussions only Photos only Videos p

conformability error 503

Conformability Error table id toc tbody tr td div id toctitle Contents div ul li a href Stata Matrix a li ul td tr tbody table p in inteff Date Fri May BST --- Chin-Chih chen umn edu wrote I was trying to run relatedl 'Inteff to obtain the marginal effects of interactive conformability error in stata terms in probit via STATA After running the probit command conformability error I tried to run inteff and I got the following message conformability error r Does anyone know stata conformability error matrix what conformability error means and how can I fix it

conformability error prgen

Conformability Error Prgen p Date relatedl Prev Date Next Thread Prev Thread Next Date Index Thread Index st conformability error stata RE Confomability error From Martin Weiss martin weiss gmx de To conformability error stata matrix statalist hsphsun harvard edu Subject st RE Confomability error Date Fri Mar stata conformability error r -set trace on- and see where -prgen- part of -findit spost ado- by Scott Long et al gets stuck HTH Martin -----Original Message----- From owner-statalist hsphsun harvard edu mailto owner-statalist hsphsun harvard edu On Behalf Of Luis Ortiz Sent Freitag M xE rz To statalist hsphsun harvard edu

conformability error stata

Conformability Error Stata table id toc tbody tr td div id toctitle Contents div ul li a href Stata Factor Conformability Error a li li a href Stata Mata Conformability a li li a href Stata Conformability Error a li ul td tr tbody table p Date Prev Date Next Thread Prev Thread Next Date Index Thread Index Re st conformability error when writing to stata variable from mata From Aaron relatedl Kirkman ak mailserv gmail com To statalist hsphsun harvard edu Subject Re st conformability conformability error stata r error when writing to stata variable from mata Date Mon

conformability error stata 503

Conformability Error Stata table id toc tbody tr td div id toctitle Contents div ul li a href Conformability Error In Stata a li ul td tr tbody table p Fri Jan - Just to report back to anyone interested on the list Namratha's problem was relatedl caused because some variables were dropped from the estimation conformability error stata matrix due to collinearity in one or more of the replicate samples p h id Conformability Error In Stata p which means that variances can't be calculated for this model in this sample -svrmodel- should--and eventually will--catch conformability error stata synth

conformability error units

Conformability Error Units table id toc tbody tr td div id toctitle Contents div ul li a href Conformability Error In Stata a li li a href Stata Matrix Conformability Error a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and relatedl policies of this site About Us Learn more about Stack Overflow p h id Conformability Error In Stata p the company Business Learn more about hiring developers or posting ads with us Unix conformability error Linux Questions

conformability error matrix

Conformability Error Matrix table id toc tbody tr td div id toctitle Contents div ul li a href Stata Conformability Error R a li li a href Stata Conformability Error Matrix a li li a href Stata Conformability Error a li ul td tr tbody table p st Conformability error in creating matrix while cross-tabulating data Date Thu Jul - Dear Statalist I am trying to get the frequency of relatedl certain variables and put it in a matrix see conformability error in stata code below I need to cross tabulate each variable q -q with each conformability error variable

conformability error

Conformability Error table id toc tbody tr td div id toctitle Contents div ul li a href Conformability Error In Stata a li li a href Xtpmg Conformability Error a li li a href Conformability Error Stata Factor a li li a href Conformability Error Mata a li ul td tr tbody table p Date Prev Date Next Thread Prev Thread Next Date Index Thread Index Re st conformability relatedl error when writing to stata variable from mata From p h id Conformability Error In Stata p Aaron Kirkman ak mailserv gmail com To statalist hsphsun harvard edu Subject Re

conformability error r503

Conformability Error R table id toc tbody tr td div id toctitle Contents div ul li a href Stata Matrix a li ul td tr tbody table p Fri Jan - Just to report back to anyone interested on relatedl the list Namratha's problem was caused because conformability error in stata some variables were dropped from the estimation due to collinearity conformability error in one or more of the replicate samples which means that variances can't be calculated for stata matrix conformability error this model in this sample -svrmodel- should--and eventually will--catch this and issue a more reasonable error message

conformability error mata

Conformability Error Mata table id toc tbody tr td div id toctitle Contents div ul li a href Stata Conformability Error a li li a href Conformability Error Stata Matrix a li li a href Stata Mata a li ul td tr tbody table p Date Prev Date Next Thread Prev Thread Next Date Index Thread Index Re st conformability error when writing relatedl to stata variable from mata From Nick Cox p h id Stata Conformability Error p njcoxstata gmail com To statalist hsphsun harvard edu statalist hsphsun harvard edu Subject Re st conformability error when conformability error stata

cross 3200 conformability error

Cross Conformability Error table id toc tbody tr td div id toctitle Contents div ul li a href Stata Conformability Error a li li a href Conformability Error Stata Matrix a li ul td tr tbody table p 'Login or Register' at the top-right of this page For more information on Statalist see the FAQ Announcement Collapse No announcement relatedl yet X Collapse Posts Latest Activity Search Page of Filter p h id Stata Conformability Error p Time All Time Today Last Week Last Month Show All Discussions only Photos only Videos conformability error stata only Links only Polls only

prchange conformability error

Prchange Conformability Error table id toc tbody tr td div id toctitle Contents div ul li a href Stata Conformability Error R a li li a href Conformability Error Stata Factor a li ul td tr tbody table p Fri Jan - Just to report back to anyone interested on the list Namratha's problem was caused because some variables were dropped from relatedl the estimation due to collinearity in one or more p h id Stata Conformability Error R p of the replicate samples which means that variances can't be calculated for this stata conformability error matrix model in this