全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
18301 4
2012-08-03
看书看到这个,看不懂。。。也查不到。。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2012-8-4 06:53:15
变量列表
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2015-6-5 08:51:25
楼上正解
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2015-6-5 17:50:08
帮助里面有介绍

Title

    [U] 11.4 varlists


Description

    A varlist is a list of variable names.  The variable names in a varlist refer either
    exclusively to new (not yet created) variables or exclusively to existing variables. A
    newvarlist always refers exclusively to new (not yet created) variables.  Similarly, a
    varname refers to one variable, either existing or not yet created.  A newvar always
    refers to one new variable.

    Sometimes a command will refer to a varname in another way, such as "groupvar".  This is
    still a varname.  The different name is used to give you an extra hint about the purpose
    of that variable.  For example, a groupvar is the name of a variable that defines groups
    within your data.

    Examples include

        myvar                   just one variable
        myvar thisvar thatvar   three variables
        myvar*                  variables starting with myvar
        *var                    variables ending with var
        my*var                  variables starting with my & ending with var with any number
                                  of other characters between
        my~var                  one variable starting with my & ending with var with any
                                  number of other characters between
        my?var                  variables starting with my & ending with var with one other
                                  character between
        myvar1-myvar6           myvar1, myvar2, ..., myvar6 (probably)
        this-that               variables this through that, inclusive

    The * character indicates to match one or more characters.  All variables matching the
    pattern are returned.

    The ~ character also indicates to match one or more characters, but unlike *, only one
    variable is allowed to match.  If more than one variable matches, an error message is
    presented.

    The ? character matches one character.  All variables matching the pattern are returned.

    The - character indicates that all variables in the dataset, starting with the variable
    to the left of the - and ending with the variable to the right of the - are to be
    returned.


    Many commands understand the keyword _all to mean all variables.  Some commands default
    to using all variables if none are specified.


    Factor variables are extensions of varlists of existing variables.  When a command allows
    factor variables, in addition to typing variable names from your data, you can type
    factor variables using factor-variable operators.

    Factor variables create indicator variables from categorical variables, interactions of
    indicators of categorical variables, interactions of categorical and continuous
    variables, and interactions of continuous variables (polynomials).

    There are five factor-variable operators:

         Operator  Description
         ------------------------------------------------------------------------------------
         i.        unary operator to specify indicators
         c.        unary operator to treat as continuous
         o.        unary operator to omit a variable or indicator
         #         binary operator to specify interactions
         ##        binary operator to specify factorial interactions
         ------------------------------------------------------------------------------------

    For complete syntax and usage of factor variables, see fvvarlist.


    Time-series varlists are a variation on varlists of existing variables.  When a command
    allows a time-series varlist, you may include time-series operators.  For instance, L.gnp
    refers to the lagged value of variable gnp.  The time-series operators are

        Operator  Meaning
        ---------------------------------------------------------
        L.        lag (x_t-1)
        L2.       2-period lag (x_t-2)
        ...
        F.        lead (x_t+1)
        F2.       2-period lead (x_t+2)
        ...
        D.        difference (x_t - x_t-1)
        D2.       difference of difference (x_t - 2x_t-1 + x_t-2)
        ...
        S.        "seasonal" difference (x_t - x_t-1)
        S2.       lag-2 (seasonal) difference (x_t - x_t-2)
        ...
        ---------------------------------------------------------

    Time-series operators may be repeated and combined and both lowercase and uppercase
    letters are understood.  For more details, see help tsvarlist.


Examples

    . webuse census4
    . describe

    These four regress commands are equivalent.
    . regress brate medage medagesq reg2 reg3 reg4
    . regress brate medage medagesq reg2-reg4
    . regress brate med* reg2-reg4
    . regress brate medage c.medage#c.medage i.region

    . summarize _all

    . sysuse citytemp
    . describe

    . summarize *dd
    . summarize temp*
    . summarize temp???
    . summarize t*n

    . webuse fvex
    . describe

    . regress y distance i.group
    . regress y i.sex sex#c.distance

    These two commands are equivalent.
    . regress y distance i.sex i.group sex#group
    . regress y distance sex##group


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2022-9-29 15:37:45
valist指的就是你在stata中输入的变量
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群