Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: Counting occurences & correlation matrix


From   "Michael Blasnik" <[email protected]>
To   <[email protected]>
Subject   st: Re: Counting occurences & correlation matrix
Date   Wed, 27 Dec 2006 10:00:27 -0500

...
1) count if pw==1 & e(sample)

2) ssc install mat2txt
mat2txt, matrix(R) saving(mycorr.csv)

(preferred answer -- don't)

If you had used the help system, you could have figured this out farly easily

M Blasnik

----- Original Message ----- From: "Claude Francoeur" <[email protected]>
To: <[email protected]>
Sent: Tuesday, December 26, 2006 4:57 PM
Subject: st: Counting occurences & correlation matrix



Hello,

1- Counting occurences

I want to count the number of times the variable pw=1 is used in the
following regression :

. xtprobit pw boardcomp compensation shrights disclosure tech mv endet cot
volat march conc, pa i(i)

My dataset contains 781 observations, but only 581 were used in the reg.

I did:
. count if pw==1
  47

This is not the count that I need. There are actually 47 pw=1 in the
original dataset, but how many are there in the e(sample)?


2- Generate a correlation matrix

I did :

. matrix accum R = pw boardcomp compensation shrights disclosure tech mv
endet cot volat march conc, nocons dev
(obs=581)

.  matrix R = corr(R)

Now, how do I export the matrix to Excel?
*
*   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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index