mkspline.hlp
来自「是一个经济学管理应用软件 很难找的 但是经济学学生又必须用到」· HLP 代码 · 共 100 行
HLP
100 行
{smcl}
{* 06dec2004}{...}
{cmd:help mkspline}{right:dialog: {bf:{dialog mkspline}}}
{hline}
{title:Title}
{p2colset 5 21 23 2}{...}
{p2col :{hi:[R] mkspline} {hline 2}}Linear spline construction{p_end}
{p2colreset}{...}
{title:Syntax}
{phang}
Linear spline with knots at specified points
{p 8 17 2}
{cmd:mkspline}
{it:{help newvar:newvar_1}}
{it:#1}
[{it:{help newvar:newvar_2}}
{it:#2}
[{it:...}]]
{it:{help newvar:newvar_k}}
{cmd:=}
{it:oldvar}
{ifin}
[{cmd:,}
{opt m:arginal}]
{phang}
Linear spline with knots equally spaced or at percentiles of data
{p 8 17 2}
{cmd:mkspline}
{it:stubname}
{it:#}
{cmd:=}
{it:oldvar}
{ifin}
[{cmd:,} {opt m:arginal} {opt p:ctile}]
{title:Description}
{pstd}
{opt mkspline} creates variables containing a linear spline of {it:oldvar}.
{pstd}
In the first syntax, {opt mkspline} creates {it:newvar_1}, ...,
{it:newvar_k} containing a linear spline of {it:oldvar} with knots at the
specified {it:#1}, ..., {it:#k-1}.
{pstd}
In the second syntax, {opt mkspline} creates {it:#} variables named
{it:stubname}{opt 1}, ..., {it:stubname#} containing a linear spline of
{it:oldvar}. The knots are equally spaced over the range of {it:oldvar} or are
placed at the percentiles of {it:oldvar}.
{title:Options}
{dlgtab:Options}
{phang}
{opt marginal} specifies that the new variables be constructed
so that, when used in estimation, the coefficients represent the change in the
slope from the preceding interval. The default is to construct the variables
so that, when used in estimation, the coefficients measure the slopes for the interval.
{phang}
{opt pctile} is allowed only with the second syntax. It specifies that
the knots be placed at percentiles of the data rather than being equally
spaced over the range.
{title:Examples}
{phang}{cmd:. mkspline age1 20 age2 30 age4 50 age5 60 age6 = age}{p_end}
{phang}{cmd:. regress lninc educ age1-age6}{p_end}
{phang}{cmd:. test age2 = age1}
{phang}{cmd:. mkspline age1 20 age2 30 age4 50 age5 60 age6 = age}{p_end}
{phang}{cmd:. regress lninc educ age1-age6}{p_end}
{phang}{cmd:. test age2 = 0}
{phang}{cmd:. mkspline dose 5 = dosage, pctile}{p_end}
{phang}{cmd:. logistic outcome dose1-dose5}
{title:Also see}
{psee}
Manual: {bf:[R] mkspline}
{psee}
Online: {helpb fracpoly}
{p_end}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?