SAS 的 IRR 普通计算器怎么求irr求

SAS Data Analysis Examples: Poisson Regression
SAS Data Analysis Examples
Poisson Regression
Poisson regression is for modeling count variables.
Please note: The purpose of this page is to show how to use various data
analysis commands.& It does not cover all aspects of the research process which
researchers are expected to do.& In particular, it does not cover data
cleaning and checking, verification of assumptions, model diagnostics or
potential follow-up analyses.
This example was done using SAS version 9.22.&
Examples of Poisson regression
Example 1.& The number of persons killed by mule or horse kicks in the
Prussian army per year.&von Bortkiewicz collected data from 20 volumes of
Preussischen Statistik.&These data were collected on 10 corps of
the Prussian army in the late 1800s over the course of 20 years.
Example 2.& A health-related researcher is studying the number of
hospital visits in past 12 months by senior citizens in a community based on the
characteristics of the individuals and the types of health plans under which
each one is covered.&&
Example 3.& A researcher in education is interested in the association
between the number of awards earned by students at one high school and the students' performance in math and the
type of program (e.g., vocational, general or
academic) in which students were enrolled.
Description of the data
For the purpose of illustration, we have simulated a data set for Example 3
. In this example,
num_awards is the outcome variable and indicates the number of awards earned
by students at a high school in a year, math is a continuous predictor
variable and represents students' scores on their math final exam, and prog
is a categorical predictor variable with three levels indicating the type of
program in which the students were enrolled.&It is coded as 1 = &General&, 2 =
&Academic& and 3 = &Vocational&.
proc means data = poisson_si
The MEANS Procedure
-----------------------------------------------------------------------------------------------
num_awards
math score
52.6450000
87.7678141
33.0000000
75.0000000
-----------------------------------------------------------------------------------------------
Each variable has 200 valid observations and their distributions seem quite
reasonable. The unconditional mean and variance of our outcome variable
are not extremely different. Our model assumes that these values, conditioned on
the predictor variables, will be equal (or at least roughly so).
We can look at summary statistics by program type. The table below shows the
mean and variance of numbers of awards by program type and seems to suggest that
program type is a good candidate for predicting the number of awards, our
outcome variable, because the mean value of the outcome appears to vary by
prog. Additionally, the means and variances within each level of prog--the
conditional means and variances--are similar. A frequency plot is also produced
to display the distribution of the outcome variable.
proc means data = poisson_
The MEANS Procedure
Analysis Variable : num_awards
---------------------------------------------------
---------------------------------------------------
proc freq data=poisson_
tables num_awards / plots=
proc freq data = poisson_
The FREQ Procedure
type of program
Cumulative
Cumulative
---------------------------------------------------------
Analysis methods you might consider
Below is a list of some analysis methods you may have
encountered.& Some of the methods listed are quite reasonable, while others have
either fallen out of favor or have limitations.&
Poisson regression - Poisson regression is often used for modeling count
data. It has a number of extensions useful for count models.
Negative binomial regression - Negative binomial regression can be used
for over-dispersed count data, that is when the conditional variance exceeds
the conditional mean. It can be considered as a generalization of Poisson
regression since it has the same mean structure as Poisson regression and it
has an extra parameter to model the over-dispersion.&If the conditional
distribution of the outcome variable is over-dispersed, the confidence
intervals for Negative binomial regression are likely to be narrower as
compared to those from a Poisson regession.
Zero-inflated regression model - Zero-inflated models attempt to account
for excess zeros.& In other words, two kinds of zeros are thought to exist
in the data, &true zeros& and &excess zeros&.& Zero-inflated models estimate
two equations simultaneously, one for the count model and one for the excess
OLS regression - Count outcome variables are sometimes log-transformed
and analyzed using OLS regression.& Many issues arise with this approach,
including loss of data due to undefined values generated by taking the log
of zero (which is undefined) and biased estimates.
Poisson regression analysisAt this point, we are ready to perform
our Poisson model analysis. Proc genmod is usually used for Poisson regression analysis in SAS.On the class statement we list the variable prog, since prog
is a categorical variable.&
We use the global option param = glm so we can save the model using the
store statement for future post estimations. The type3 option in
the model statement is
used to get the multi-degree-of-freedom test of the categorical variables listed
on the class statement, and the dist = poisson option is used to
indicate that a Poisson distribution should be used.& Statement &store&
allows us to store the parameter estimates to a data set, which we call p1, so
we can perform post estimation without rerunning the model.
proc genmod data = poisson_
class prog
model num_awards = prog math / type3 dist=
The GENMOD Procedure
Model Information
WORK.POISSON_SIM
Distribution
Link Function
Dependent Variable
num_awards
Number of Observations Read
Number of Observations Used
Class Level Information
Criteria For Assessing Goodness Of Fit
Scaled Deviance
Pearson Chi-Square
Scaled Pearson X2
Log Likelihood
Full Log Likelihood
AIC (smaller is better)
AICC (smaller is better)
BIC (smaller is better)
Algorithm converged.
Analysis Of Maximum Likelihood Parameter Estimates
Wald 95% Confidence
Chi-Square
Pr > ChiSq
The output begins with the basic model information and then provides a list
of goodness-of-fit statistics including the log likelihood, AIC, and BIC.
Next you will find the Poisson regression coefficients for each of the
variables along with standard errors, Wald Chi-Square statistics and intervals,
and p-values for the coefficients.& The coefficient for math is .07.&
This means that the expected increase in log count for a one-unit increase in
math is .07. For our three-level categorical predictor prog, the
model presents coefficients relating levels 1 and 2 to level 3. The indicator
variable prog(2) is the expected difference in log count between group 2
(prog=2) and the reference group (prog=3).& So the expected log
count for level 2 of prog is 0.714 higher than the expected log count for
level 3 of prog. Similarly the expected log count for level 1 of prog
is 0.3698 lower than the expected log count for level 3.
To determine if prog itself, overall, is statistically significant,
we can look at the Type 3 table in the outcome that includes the two
degrees-of-freedom test of this variable. This is testing the null hypothesis
that both prog estimates (level 1 vs. level 3 and level 2 vs. level 3)
are equal to zero. We see there that prog is a statistically significant
predictor.
To help assess the fit of the model, we can use the goodness-of-fit
chi-squared test. This assumes the deviance follows a chi-square distribution
with degrees of freedom equal to the model residual. From the first line of our
Goodness of Fit output, we can see these values are 189.4495 and 196.
df = 196; chisq = 189.4495;
pvalue = 1 - probchi(chisq, df);
proc print data =
This is not a test of the model coefficients (which we saw in
the header information), but a test of the model form: Does the poisson model
form fit our data? We conclude that the model fits reasonably well because the
goodness-of-fit chi-squared test is not statistically significant.& If the test
had been statistically significant, it would indicate that the data do not fit
the model well.& In that situation, we may try to determine if there are omitted
predictor variables,& if our linearity assumption holds and/or if there is an
issue of over-dispersion.
Cameron and Trivedi (2009) recommend using robust standard errors for the
parameter estimates to control for mild violation of the distribution assumption
that the variance equals the mean. In SAS, we can do this by running
proc genmod with the repeated statement in order to obtain robust
standard errors for the Poisson regression coefficients.
proc genmod data = poisson_
class prog id /param=
model num_awards = prog math /dist=
repeated subject=
GEE Model Information
Correlation Structure
Independent
Subject Effect
id (200 levels)
Number of Clusters
Correlation Matrix Dimension
Maximum Cluster Size
Minimum Cluster Size
Algorithm converged.
GEE Fit Criteria
Analysis Of GEE Parameter Estimates
Empirical Standard Error Estimates
95% Confidence
Z Pr > |Z|
We can see that our estimates are unchanged, but our standard errors are
slightly different.
We have the model stored in a data set called p1. Using proc plm, we can request many
different post estimation tasks. For example, we might want to displayed the
results as incident rate ratios (IRR). We can do so with a data step
after using proc plm to create a dataset of our model estimates.
ods output ParameterEstimates =
proc plm source = p1;
& irr = exp(estimate);
& if parameter ^=&Intercept&;
proc print data = est_
Obs&&& Parameter&&&&&&&&&&& prog&&& Estimate&&&&& StdErr&&&&& irr
1&&&& type of program 1&&&& 1&&&&&& -0.3698&&&&& 0.4411&&& 0.69087
2&&&& type of program 2&&&& 2&&&&&&& 0.7140&&&&& 0.3200&&& 2.04225
3&&&& type of program 3&&&& 3&&&&&&&&&&&& 0&&&&&&&&&& .&&& 1.00000
4&&&& math score&&&&&&&&&&& _&&&&&& 0.07015&&&& 0.01060&&& 1.07267
The output above indicates that the incident rate for prog=2 is 2.04
times the incident rate for the reference group (prog=3).& Likewise, the
incident rate for prog=1 is 0.69 times the incident rate for the
reference group holding the other variables constant.&The percent change in the
incident rate of num_awards is by 7% for every unit increase in math.
Recall the form of our model equation:
log(num_awards) = Intercept + b1(prog=1) + b2(prog=2)
This implies:
num_awards = exp(Intercept + b1(prog=1) + b2(prog=2)+
b3math) = exp(Intercept) * exp(b1(prog=1)) * exp(b2(prog=2))
* exp(b3math)
The coefficients have an additive effect in the log(y) scale and the
IRR have a multiplicative effect in the y scale.
For additional information on the various metrics in which the results can be
presented, and the interpretation of such, please see Regression Models for
Categorical Dependent Variables Using Stata, Second Edition by J. Scott Long
and Jeremy Freese (2006).
Below we use lsmeans statements in proc plm to calculate the predicted number of events at each level of
prog, holding all other variables (in this example, math) in the
model at their means.
We use the &ilink& option (for inverse link) to get the predicted means
(predicted count) in addition to the linear predictions.&
proc plm source = p1;
& lsmeans prog /
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& prog Least Squares Means
type of&&&&&&&&&&&&&&& Standard
program&&& Estimate&&&&&& Error&&& z Value&&& Pr & |z|&&&& Alpha&&&&&& Lower&&&&&& Upper
1&&&&&&&&&& -1.5540&&&&& 0.3335&&&&& -4.66&&&&& &.0001&&&&& 0.05&&&& -2.2076&&&& -0.9003
2&&&&&&&&&& -0.4701&&&&& 0.1381&&&&& -3.40&&&&& 0.0007&&&&& 0.05&&&& -0.7407&&&& -0.1995
3&&&&&&&&&& -1.1841&&&&& 0.2887&&&&& -4.10&&&&& &.0001&&&&& 0.05&&&& -1.7499&&&& -0.6183
&&&&&&&&&&&&&& prog Least Squares Means
&&&&&&&&&&&&&&&&&&&&&& Standard
type of&&&&&&&&&&&&&&& Error of&&&&&& Lower&&&&&& Upper
program&&&&&&& Mean&&&&&&& Mean&&&&&&& Mean&&&&&&& Mean
1&&&&&&&&&&& 0.2114&&&& 0.07050&&&&& 0.1100&&&&& 0.4064
2&&&&&&&&&&& 0.6249&&&& 0.08628&&&&& 0.4768&&&&& 0.8191
3&&&&&&&&&&& 0.3060&&&& 0.08834&&&&& 0.1738&&&&& 0.5388
The first block of output above shows the predicted log count. The second
block shows predicted number of events in the &mean& column.
In the output above, we see that the predicted number of events for level 1
of prog is about .21, holding math at its mean.& The predicted
number of events for level 2 of prog is higher at .62, and the predicted
number of events for level 3 of prog is about .31. Note that the
predicted count of level 1 of prog is (.) = 0.6908 times the
predicted count for level 3 of prog. This matches what we saw in the IRR
output table.
Below we will obtain the averaged predicted counts for values of math
that range from 35 to 75 in increments of 10, using a data step and the score
statement of proc plm.
& set poisson_
& do math_cat = 35 to 75 by 10;
&&&& math = math_
proc plm source=p1;
& score data = toscore out=math /
proc means data =
& class math_
&&&&&&&&&&&&&&&&&& N
&&& math_cat&&&& Obs&&&&&&&&&&& Mean
------------------------------------
&&&&&&&&& 35&&&& 200&&&&&& 0.1311326
&&&&&&&&& 45&&&& 200&&&&&& 0.2644714
&&&&&&&&& 55&&&& 200&&&&&& 0.5333923
&&&&&&&&& 65&&&& 200&&&&&& 1.0757584
&&&&&&&&& 75&&&& 200&&&&&& 2.1696153
The table above shows that with prog at its observed values and
math held at 35 for all observations, the average predicted count (or average number of awards) is about .13; when
math = 75, the average predicted count is about 2.17.
If we compare the predicted counts at math = 35 and math = 45, we can see that the ratio is (.11326) = 2.017. This matches the IRR of 1.0727 for a 10 unit change: 1.0727^10 = 2.017.
You can graph the predicted number of events using proc plm and
sgplot below.&
ods html style=
proc plm source=p1;
& score data = poisson_sim out=pred /
proc sort data =
proc sgplot data =
& series x = math y = predicted /group=
Things to consider
When there seems to be an issue of dispersion, we should first check if
our model is appropriately specified, such as omitted variables and
functional forms. For example, if we omitted the predictor variable prog
in the example above, our model would seem to have a problem with
over-dispersion. In other words, a mis-specified model could present a
symptom like an over-dispersion problem.&
Assuming that the model is correctly specified,& you may want to
check for overdispersion.&
There are several tests& including the likelihood ratio test of
over-dispersion parameter alpha by running the same regression model using
negative binomial distribution.
One common cause of over-dispersion is excess zeros, which in turn are
generated by an additional data generating process. In this situation,
a zero-inflated model should be considered.
If the data-generating process does not allow for any 0s (such as the
number of days spent in the hospital), then a zero-truncated model may be
more appropriate.
The outcome variable in a Poisson regression cannot have negative
Poisson regression is estimated via maximum likelihood estimation. It
usually requires a large sample size.
References
Cameron, A. C. and& Trivedi, P. K.& 2009.& Microeconometrics Using
Stata.& College Station, TX:& Stata Press.
Cameron, A. C. and& Trivedi, P. K.& 1998.& Regression
Analysis of Count Data.& New York:& Cambridge Press.
Cameron, A. C.& Advances in Count Data Regression Talk for the
Applied Statistics Workshop, March 28, 2009.
Dupont, W. D.& 2002.& Statistical Modeling for Biomedical
Researchers:& A Simple Introduction to the Analysis of Complex Data.&
New York:& Cambridge Press.
Long, J. S. 1997. Regression Models for Categorical and Limited Dependent Variables.
Thousand Oaks, CA: Sage Publications.
Long, J. S. and Freese, J.& 2006.& Regression Models for
Categorical Dependent Variables Using Stata, Second Edition.&
College Station, TX:& Stata Press.
SAS Online Manual
The content of this web site should not be construed as an endorsement
of any particular web site, book, or software product by the
University of California.Excel 求解NPV和IRR。方法和实例_中华文本库
第1页/共2页
第一步:启动office07 Excel电子表格
第二步:在"公式"选择"财务",函数名里选择"NPV"。
第三步:输入相关参数,点确定求NPV。
(求IRR基本同NPV)
例1:某项目计算期为5年,各年净现金流量分别为,-1,,5000,该项目基准收益率为11%,求NPV,并分析项目是否可行。情况一:将开始投资的10000 作为数值参数中的一个
情况二:将开始投资的10000 不作为数值参数中的一个
第1页/共2页
寻找更多 ""BOINCstats/BAM! | World Community Grid - “Sash84” 的超越统计 德国 里
要体验 BOINCstats 的完整功能,你必须启用浏览器的 Javascript 功能。
由 Yin Gang 翻译,欢迎加入 Team China 团队!
World Community Grid
最近的每日更新:
15:51:57 GMT17:57:09 之前
最近的增量更新:
09:28:48 GMT00:23:12 之前
BOINCstats 服务器时间:
09:52:12 GMT
当前在线:
Peppernrino:
@lysimachos: in &Overview& tab. the 6th section labelled &Link to user's hosts stats&. click the little network icon.
Peppernrino:
@lysimachos: /en/stats/-1/host/list/0/0/17bfe341cb5bd6f8c1a165 your name takes me to that page
where exactly can i see the progress of each of my computers?
@ritterm Thank You and I will
Thank you jerji! quick question:my laptop is doing OK but my tablet app(a cheap one, $50)doesn't seem to work..
welcome lysimachos. Keep on crunching. It is surprising how quickly the credits add up and you start climbing the ladder
hello everyone! I'm so excited about boinc, newbie here!
@aleluyeah: Great 'stone. Crunch on!
@MarkRBright Thank You for a good word
超越统计Sash84德国 里
将被 Sash84 超越:
Masterchief44556
LiquidDeath
christiane_ris
Lumpenstrumpf
将超越 Sash84:
Martin Grillmaier
beckerstef
Mitchel BN
wwinkelmeier
DigitalFighter
marc_dirsus
SquirrelCmD
Markus2020
Papagiorgio
Matthias Irrgang
MyoneandOnly
LR-worldcommunitygrid
Daniel Liebmann您的举报已经提交成功,我们将尽快处理,谢谢!
贴现,银行有标准的;资金成本率,企业标准,每家不一样的。
大家还关注
(window.slotbydup=window.slotbydup || []).push({
id: '2081942',
container: s,
size: '1000,60',
display: 'inlay-fix'请问这题实际利率IRR是怎么求出来的_百度知道
请问这题实际利率IRR是怎么求出来的
com/zhidao/wh%3D450%2C600/sign=/zhidao/wh%3D600%2C800/sign=04b12ceca8f27ad086e061d950a7bcd162d9f3d3c988.hiphotos.baidu.baidu://b.hiphotos.jpg" esrc="/zhidao/pic/item/4d086e061d950a7bcd162d9f3d3c988.baidu.hiphotos://b.jpg" target="_blank" title="点击查看大图" class="ikqb_img_alink"><img class="ikqb_img" src="http://b/link.8%先看看插值法说明.9%再设IRR=0.baidu:<a href="http://baike.baidu用插值法计算先设IRR=0
插值法看不懂。。请问可以说得更详细些吗?
(为什么要设置0.9%和0.8%就是个人估计的结果,估计得越接近计算的结果越精确)先设IRR=0.9%
计算式子右边得出0591再设IRR=0.8%
计算式子右边得出0588然后:(IRR-0.9%)&#47;(0.9%-0.8%)=()&#47;(.4130588)计算得出IRR就行了
提问者评价
来自团队:
其他类似问题
为您推荐:
irr的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁

我要回帖

更多关于 如何用计算器求irr 的文章

 

随机推荐