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

st: Re: how to get dfbetas in Stataintercooler with more than 800 observations

From   Kit Baum <>
Subject   st: Re: how to get dfbetas in Stataintercooler with more than 800 observations
Date   Sun, 6 Apr 2008 06:14:39 -0400

Yes, without a Stata matrix, which has limits; use Mata.

 webuse stan3, clear
 stcox age posttran surgery year, esr(r*)
 tomata r*   // requires tomata from ssc
 forv i=1/4 {
 	g Inf`i' = .
 V = st_matrix("e(V)")
 st_view(Inf, ., ("Inf1", "Inf2", "Inf3", "Inf4"))
 Inf[., .] = (r1, r2, r3, r4) * V

// double check against [ST] p.174
mkmat r*, mat(esr)
mat V = e(V)
mat Inf2 = esr * V
svmat Inf2, names(s)
forv i=1/4 {
	g check`i' = Inf`i' - s`i'
su check*
The second block of code, using Stata matrices, is limited by matsize. The Mata code is not, and uses less memory than the Stata matrix solution in any case by the use of views. All of the check variables being identically zero shows that the two methods are identical.

Kit Baum, Boston College Economics and DIW Berlin
An Introduction to Modern Econometrics Using Stata:

On Apr 6, 2008, at 02:33 , Jose wrote:

I ran stcox with 1473 observations, each with two variables (sexo,
admaecentro), plus the time of failure (tempoemdias) and the indicator of
censoring (status).
To analyse for the leverage (influence) possibility, I followed page 174 of
the version 10 manual, and I commanded and got :
stcox sexo idmaecentro, esr(esr*)
set matsize 800
mkmat esr1 esr2, matrix(esr)
matsize too small to create a [1473,2] matrix
The error was expected, since my Stata is Intercooled, limited to matrix
Is there a way to get the dfbetas, not through matrix?
*   For searches and help try:

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