找回密码
 注册
查看: 765|回复: 0

R语言 spdep包 impacts()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-30 14:38:40 | 显示全部楼层 |阅读模式
impacts(spdep)
impacts()所属R语言包:spdep

                                        Impacts in spatial lag models
                                         在空间滞后模型的影响

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

The calculation of impacts for spatial lag and spatial Durbin models is needed in order to interpret the regression coefficients correctly, because of the spillovers between the terms in these data generation processes (unlike the spatial error model).
空间滞后和空间德宾模型的影响是必要的,正确的,因为这些数据生成过程(不同的空间误差模型)中的条款之间的溢出效应来解释回归系数的计算。


用法----------Usage----------


## S3 method for class 'sarlm'
impacts(obj, ..., tr, R = NULL, listw = NULL, useHESS = NULL, tol = 1e-06, empirical = FALSE, Q=NULL)
## S3 method for class 'stsls'
impacts(obj, ..., tr, R = NULL, listw = NULL, tol = 1e-06, empirical = FALSE, Q=NULL)
## S3 method for class 'gmsar'
impacts(obj, ..., tr, R = NULL, listw = NULL, tol = 1e-06, empirical = FALSE, Q=NULL)
## S3 method for class 'lagImpact'
plot(x, ..., choice="direct", trace=FALSE, density=TRUE)
## S3 method for class 'lagImpact'
print(x, ..., reportQ=NULL)
## S3 method for class 'lagImpact'
summary(object, ..., zstats=FALSE, short=FALSE, reportQ=NULL)
## S3 method for class 'lagImpact'
HPDinterval(obj, prob = 0.95, ..., choice="direct")



参数----------Arguments----------

参数:obj
A sarlm spatial regression object created by lagsarlm; in HPDinterval.lagImpact, a lagImpact object
lagsarlm中HPDinterval.lagImpact,一个lagImpact对象创建一个sarlm空间回归对象


参数:...
Arguments passed through to methods in the coda package
传递参数的方法,在coda包


参数:tr
A vector of traces of powers of the spatial weights matrix created using trW, for approximate impact measures; if not given, listw must be given for exact measures (for small to moderate spatial weights matrices); the traces must be for the same spatial weights as were used in fitting the spatial regression
使用的矢量权力的空间权重矩阵的痕迹trW,近似影响的措施;如果没有给出,listw必须给出确切的措施(小到中雨空间权重矩阵);走线必须是相同的空间权重被用于安装的空间回归


参数:R
If given, simulations are used to compute distributions for the impact measures, returned as mcmc objects
如果给出,模拟用于计算分布的影响的措施,作为mcmc对象返回


参数:listw
If tr is not given, a spatial weights object as created by nb2listw; they must be the same spatial weights as were used in fitting the spatial regression
tr如果没有给出,对象创建空间权重nb2listw;他们必须是相同的空间权重被用于安装的空间回归


参数:useHESS
Use the Hessian approximation (if available) even if the asymptotic coefficient covariance matrix is available; used for comparing methods
使用Hessian的近似系数的渐近协方差矩阵(如果有的话),即使是用于比较的方法


参数:tol
Argument passed to mvrnorm: tolerance (relative to largest variance) for numerical lack of positive-definiteness in the coefficient covariance matrix
参数传递给mvrnorm:宽容(相对最大变化)的数值缺乏的系数协方差矩阵的正定性,


参数:empirical
Argument passed to mvrnorm (default FALSE): if true, the coefficients and their covariance matrix specify the empirical not population mean and covariance matrix
参数传递给mvrnorm(默认为false):如果为真,系数和协方差矩阵指定的经验而不是人口的均值和协方差矩阵


参数:Q
default NULL, else an integer number of cumulative power series impacts to calculate if tr is given
默认为空,否则一个整数的累计幂级数的影响,计算,如果tr


参数:reportQ
default NULL; if TRUE and Q given as an argument to impacts, report impact components
默认为空,如果为true,Q作为参数impacts,报告影响组件


参数:x, object
lagImpact objects created by impacts methods
lagImpact impacts方法创建的对象


参数:zstats
default FALSE, if TRUE, also return z-values and p-values for the impacts based on the simulations
默认是false,如果为TRUE,返回z值和p值的基础上模拟的影响


参数:short
default FALSE, if TRUE passed to the print summary method to omit printing of the mcmc summaries
默认是false,如果TRUE传递给打印总结的方法,省略印刷的MCMC摘要


参数:choice
One of three impacts: direct, indirect, or total
其中的三个影响:直接的,间接的,或总


参数:trace
Argument passed to plot.mcmc: plot trace plots
参数传递给plot.mcmc:图跟踪图


参数:density
Argument passed to plot.mcmc: plot density plots
参数传递给plot.mcmc:图密度图


参数:prob
Argument passed to HPDinterval.mcmc: a numeric scalar in the interval (0,1) giving the target probability content of the intervals
参数传递给HPDinterval.mcmc:在区间(0,1)的数字标量目标的几率内容的间隔


Details

详细信息----------Details----------

If called without R being set, the method returns the direct, indirect and total impacts for the variables in the model, for the variables themselves in tha spatial lag model case, for the variables and their spatial lags in the spatial Durbin (mixed) model case. The spatial lag impact measures are computed using eq. 2.46 (LeSage and Pace, 2009, p. 38), either using the exact dense matrix (when listw is given), or traces of powers of the weights matrix (when tr is given). When the traces are created by powering sparse matrices, the exact and the trace methods should give very similar results, unless the number of powers used is very small.
如果没有R被设置,则该方法返回的直接的,间接的,总的影响在模型中的变量,变量本身在塔空间滞后模型的情况下,变量和它们的空间滞后的空间德宾(混合)模式的情况下。计算公式的的空间滞后影响措施。 2.46(勒萨热和佩斯,2009年,第38页),使用确切的稠密矩阵(当listw),或权力的权重矩阵的痕迹(当tr)。当创建的供电稀疏矩阵的痕迹,确切和跟踪的方法应得到的结果非常相似,除非使用的权力的数量是非常小的。

If R is given, simulations will be used to create distributions for the impact measures, provided that the fitted model object contains a coefficient covariance matrix.
如果R给出,模拟将被用来创建分布的影响的措施,提供拟合模型的对象包含一个系数的协方差矩阵。

The simulations are stored as mcmc objects as defined in the coda package. The simulated values of the coefficients are checked to see that the spatial coefficient remains within its valid interval — draws outside the interval are discarded.
mcmccoda包中定义的对象作为存储为模拟。的系数的模拟值进行检查,以看到保持其有效的时间间隔内的空间系数外的时间间隔被丢弃 - 绘制。

When Q and tr are given, addition impact component results are provided for each step in the traces of powers of the weights matrix up to and including the Q'th power. This increases computing time because the output object is substantially increased in size in proportion to the size of Q.
当Q和tr是给定的,除了影响组件提供的痕迹权力的权重矩阵中的每个步骤,包括Q次方。这增加了计算时间,因为在输出对象基本上是增加的大小成比例的大小Q。

The method for gmsar objects is only for those of type SARAR output by gstsls, and assume that the spatial error coefficient is fixed, and thus omitted from the coefficients and covariance matrix used for simulation.
gmsar对象的方法是只为那些typeSARAR输出gstsls,并假定的空间误差系数是固定的,因此,省略从系数和协方差矩阵用于模拟。


值----------Value----------

An object of class lagImpact.
对象的类lagImpact。

If no simulation is carried out, the object returned is a list with:
如果没有进行了仿真,返回的对象是一个列表,:


参数:direct
numeric vector
数字矢量


参数:indirect
numeric vector
数字矢量


参数:total
numeric vector
数字矢量

and a matching Qres list attribute if Q was given.
和匹配的Qres列表属性,如果Q。

If simulation is carried out, the object returned is a list with:
如果进行了仿真,返回的对象是一个列表,:


参数:res
a list with three components as for the non-simulation case, with a matching Qres list attribute if Q was given
具有三个组件的非模拟情况的列表,以匹配的Qres列表属性,如果Q给出


参数:sres
a list with three mcmc matrices, for the direct, indirect and total impacts with a matching Qmcmc list attribute if Q was given
如果mcmc给列表中有三个Qmcmc矩阵,匹配的Q列表属性的直接的,间接的,总的影响


(作者)----------Author(s)----------


Roger Bivand <a href="mailto:Roger.Bivand@nhh.no">Roger.Bivand@nhh.no</a>



参考文献----------References----------

<h3>See Also</h3>   <code>trW</code>, <code>lagsarlm</code>, <code>nb2listw</code>, <code>mvrnorm</code>, <code>plot.mcmc</code>, <code>summary.mcmc</code>, <code>HPDinterval</code>

实例----------Examples----------


example(columbus)
listw <- nb2listw(col.gal.nb)
lobj <- lagsarlm(CRIME ~ INC + HOVAL, columbus, listw)
summary(lobj)
mobj <- lagsarlm(CRIME ~ INC + HOVAL, columbus, listw, type="mixed")
summary(mobj)
W <- as(as_dgRMatrix_listw(listw), "CsparseMatrix")
trMatc <- trW(W, type="mult")
trMC <- trW(W, type="MC")
impacts(lobj, listw=listw)
impacts(lobj, tr=trMatc)
impacts(lobj, tr=trMC)
lobj1 <- stsls(CRIME ~ INC + HOVAL, columbus, listw)
loobj1 <- impacts(lobj1, tr=trMatc, R=200)
summary(loobj1, zstats=TRUE, short=TRUE)
lobj1r <- stsls(CRIME ~ INC + HOVAL, columbus, listw, robust=TRUE)
loobj1r <- impacts(lobj1r, tr=trMatc, R=200)
summary(loobj1r, zstats=TRUE, short=TRUE)
lobjIQ5 <- impacts(lobj, tr=trMatc, R=200, Q=5)
summary(lobjIQ5, zstats=TRUE, short=TRUE)
summary(lobjIQ5, zstats=TRUE, short=TRUE, reportQ=TRUE)
impacts(mobj, listw=listw)
impacts(mobj, tr=trMatc)
impacts(mobj, tr=trMC)
summary(impacts(mobj, tr=trMatc, R=200), zstats=TRUE)
## Not run: [#不运行:]
mobj1 <- lagsarlm(CRIME ~ INC + HOVAL, columbus, listw, type="mixed",
method="Matrix", fdHess=TRUE)
summary(mobj1)
summary(impacts(mobj1, tr=trMatc, R=1000), zstats=TRUE, short=TRUE)
summary(impacts(mobj, tr=trMatc, R=1000), zstats=TRUE, short=TRUE)
mobj2 <- lagsarlm(CRIME ~ INC + HOVAL, columbus, listw, type="mixed",
method="Matrix", fdHess=TRUE, optimHess=TRUE)
summary(impacts(mobj2, tr=trMatc, R=1000), zstats=TRUE, short=TRUE)
\dontrun{
mobj3 <- lagsarlm(CRIME ~ INC + HOVAL, columbus, listw, type="mixed",
method="spam", fdHess=TRUE)
summary(impacts(mobj3, tr=trMatc, R=1000), zstats=TRUE, short=TRUE)
}
data(boston)
Wb <- as(as_dgRMatrix_listw(nb2listw(boston.soi)), "CsparseMatrix")
trMatb <- trW(Wb, type="mult")
gp2mMi <- lagsarlm(log(CMEDV) ~ CRIM + ZN + INDUS + CHAS + I(NOX^2) +
I(RM^2) +  AGE + log(DIS) + log(RAD) + TAX + PTRATIO + B + log(LSTAT),
data=boston.c, nb2listw(boston.soi), type="mixed", method="Matrix",
fdHess=TRUE, trs=trMatb)
summary(gp2mMi)
summary(impacts(gp2mMi, tr=trMatb, R=1000), zstats=TRUE, short=TRUE)
data(house)
lw <- nb2listw(LO_nb)
form <- formula(log(price) ~ age + I(age^2) + I(age^3) + log(lotsize) +
   rooms + log(TLA) + beds + syear)
lobj <- lagsarlm(form, house, lw, method="Matrix",
fdHess=TRUE, trs=trMat)
summary(lobj)
loobj <- impacts(lobj, tr=trMat, R=1000)
summary(loobj, zstats=TRUE, short=TRUE)
lobj1 <- stsls(form, house, lw)
loobj1 <- impacts(lobj1, tr=trMat, R=1000)
summary(loobj1, zstats=TRUE, short=TRUE)
mobj <- lagsarlm(form, house, lw, type="mixed",
method="Matrix", fdHess=TRUE, trs=trMat)
summary(mobj)
moobj <- impacts(mobj, tr=trMat, R=1000)
summary(moobj, zstats=TRUE, short=TRUE)

## End(Not run)[#(不执行)]

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-6-18 02:04 , Processed in 0.025873 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表