Home > conformability error > conformability error matrix

Conformability Error 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 conformability error in stata code below). I need to cross tabulate each variable q271-q277 with each 3200 conformability error 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 R(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

Stata Conformability Error Matrix

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 conformability error stata factor 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: 3200 conformability error when writing to stata variable from mata From Aaron Kirkman To statalist@hsphsun2.harvard.edu Subject Re:

Stata Conformability Error 503

st: 3200 conformability error when writing to stata variable from mata Date Mon, conformability error mata 17 Sep 2012 14:17:19 -0500 That was the problem. I changed my code to use missing values for the remainder of the stata display matrix observations and that seems to work. Thank you, Aaron On Fri, Sep 14, 2012 at 12:00 AM, Nick Cox wrote: > In the problematic code you are asking Mata to put a vector of http://www.stata.com/statalist/archive/2007-07/msg00165.html length 20 > into a variable with 74 observations. By Mata's rules the two are not > conformable. > > It might be suggested that a reasonable default 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 http://www.stata.com/statalist/archive/2012-09/msg00601.html receive the > values in this vector. > > Nick > > > On 14 Sep 2012, at 05:38, Aaron Kirkman wrote: > >> I have a simple piece 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 >> : - function returned error >> >> >> This is the code that returns an error: >> ## >> >> sysuse auto, clear >> mata >> mata clear >> pmg = 1 :: 20 >> st_addvar("long","pmg") >> st_store(.,"pmg",pmg) >> end >> >> ## >> >> The following code, however, is successful (I removed the views from >> the last example because they are not relevant): >> >> ## >> >> sysuse auto, clear >> mata >> mata clear >> st_view(mpg=0,.,"mpg") >> st_view(weight=0,.,"weight") >> pmg=weight:*mpg >> st_addvar("long","pmg") >> st_store(.,"pmg",pmg) >> end >> >> ## >> >> As far as I can tell, the matrix -pmg- is of the same form in each >> example, although it differs in the number of observations. Both are >> column vectors containing only integers, so I'm not sure what is >> causing the problem. What is causing the erro

-6 6 Matrix Addition & Subtraction mat B = (1,1\4,2\-2,1) mat C = A + B mat lis C C[3,2] c1 c2 r1 3 2 r2 7 4 r3 -4 3 mat D = A - B mat lis D D[3,2] c1 c2 r1 1 0 r2 -1 0 http://www.philender.com/courses/multivariate/notes/matstata.html r3 0 1 Matrix Multiplication mat D = (2,1,3\-2,2,1) mat C = D*A mat lis C C[2,2] c1 c2 r1 1 10 r2 0 4 mat C = A*D mat lis C C[3,3] c1 c2 c3 r1 2 4 7 r2 2 7 11 r3 -8 2 -4 mat D = (2,1,3) mat C = D*A mat lis C C[1,2] c1 c2 r1 1 10 mat C = A*D conformability error r(503); Transpose of a Matrix mat AT = A' mat lis AT AT[2,3] r1 r2 r3 c1 2 3 -2 c2 1 2 2 mat conformability error ATT = AT' mat lis ATT ATT[3,2] c1 c2 r1 2 1 r2 3 2 r3 -2 2 Common Vectors Unit Vector mat U = J(3,1,1) mat lis U U[3,1] c1 r1 1 r2 1 r3 1 Common Matrices Unit Matrix mat U = J(3,2,1) mat lis U U[3,2] c1 c2 r1 1 1 r2 1 1 r3 1 1 Diagonal Matrix mat S = (2,1,4\3,2,2\-2,2,3) mat lis S S[3,3] c1 c2 c3 r1 2 1 4 r2 3 2 2 r3 -2 2 3 mat D = diag(vecdiag(S)) mat lis D symmetric D[3,3] c1 c2 stata conformability error c3 c1 2 c2 0 2 c3 0 0 3 mat V = (3,1,2) mat D = diag(V) mat lis D symmetric D[3,3] c1 c2 c3 c1 3 c2 0 1 c3 0 0 2 Identity Matrix mat I = I(3) mat lis I symmetric I[3,3] c1 c2 c3 r1 1 r2 0 1 r3 0 0 1 Symmetric Matrix Using Stata mat C = (2,1,5\1,3,4\5,4,-2) mat lis C symmetric C[3,3] c1 c2 c3 r1 2 r2 1 3 r3 5 4 -2 mat CT = C' mat lis CT symmetric CT[3,3] r1 r2 r3 c1 2 c2 1 3 c3 5 4 -2 Inverse of a Matrix matrix A = (4,2,2 \ 4,6,8 \ -2,2,4) matrix list A A[3,3] c1 c2 c3 r1 4 2 2 r2 4 6 8 r3 -2 2 4 matrix A1 = inv(A) matrix list A1 A1[3,3] r1 r2 r3 c1 1 -.5 .5 c2 -4 2.5 -3 c3 2.5 -1.5 2 Inverse & Determinant of a Matrix mat C = (2,1,6\1,3,4\6,4,-2) mat CI = syminv(C) mat lis CI symmetric CI[3,3] r1 r2 r3 c1 .6 c2 -.2 .4 c3 0 0 0 scalar d = det(C) display d -102 Number of Rows & Columns mat X = (3,2\2,-2\4,6\3,1) mat lis X X[4,2] c1 c2 r1 3 2 r2 2 -2 r3 4 6 r4 3 1 scalar r = rowsof(X) scalar c = colsof(X) display r, " ", c 4 2 Computing Column & Row Sums mat A = (2,1\3,2\-2,2) mat lis A A[3,2] c1 c2 r1 2 1 r2 3 2 r3 -2 2 mat U = J(rowsof(A),1,1) mat list U U[3,1] c1 r1 1 r2 1 r3 1 mat c = U'*A mat list c c1 c2

 

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

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 stata matrix

Conformability Error Stata Matrix table id toc tbody tr td div id toctitle Contents div ul li a href Conformability Error Stata Factor a li li a href Conformability Error Mata a li li a href Matrix Stata a li li a href Stata Mata 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 stata conformability error r code below I need to cross tabulate each variable q

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