楼主: chuchumaolunvzi
5062 4

[回归分析求助] 急问,区分处理组和控制组的多元回归问题 [推广有奖]

  • 0关注
  • 0粉丝

等待验证会员

小学生

0%

还不是VIP/贵宾

-

威望
0
论坛币
0 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
46 点
帖子
4
精华
0
在线时间
0 小时
注册时间
2013-6-8
最后登录
2013-6-10

楼主
chuchumaolunvzi 发表于 2013-6-8 21:40:25 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
您好!
       我在进行线性多元回归时,要区分处理组和控制组(已按1、0进行赋值),然后要怎样操作才能分别得出两种情况下的结果呢?
         为什么我用以下的方式不行:reg  p  ni  bv, by( icd)     【其中,P代表股价,ni代表净利润,bv代表账面价值,icd代表内部控制缺陷,即,存在内部控制缺陷为处理组,不存在内部控制为控制组】
二维码

扫码加我 拉你入群

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

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

关键词:多元回归 内部控制 REG 不存在 净利润 价值

沙发
蓝色 发表于 2013-6-9 00:15:28

Title

    [D] by -- Repeat Stata command on subsets of the data
    [U] 11 Language syntax


Syntax

        by varlist: stata_cmd

        bysort varlist: stata_cmd

    The above diagrams show by and bysort as they are typically used.  The full syntax of the commands is

        by varlist1 [(varlist2)] [, sort rc0]:  stata_cmd

        bysort varlist1 [(varlist2)] [, rc0]:  stata_cmd


Description

    Most Stata commands allow the by prefix, which repeats the command for each group of observations for which the values of
    the variables in varlist are the same.  by without the sort option requires that the data be sorted by varlist; see [D]
    sort.

    Stata commands that work with the by prefix indicate this immediately following their syntax diagram by reporting, for
    example, "by is allowed; see [D] by" or "bootstrap, by, etc., are allowed; see prefix".

    by and bysort are really the same command; bysort is just by with the sort option.

    The varlist1 (varlist2) syntax is of special use to programmers.  It verifies that the data are sorted by varlist1 varlist2
    and then performs a by as if only varlist1 were specified.  For instance,

        by pid (time): gen growth = (bp - bp[_n-1])/bp

    performs the generate by values of pid but first verifies that the data are sorted by pid and time within pid.


Options

    sort specifies that if the data are not already sorted by varlist, by should sort them.

    rc0 specifies that even if the stata_cmd produces an error in one of the by-groups, then by is still to run the stata_cmd on
        the remaining by-groups.  The default action is to stop when an error occurs.  rc0 is especially useful when stata_cmd
        is an estimation command and some by-groups have insufficient observations.


Examples

    ------------------------------------------------------------------------------------------------------------------------------
    Setup
        . sysuse auto

    For each category of foreign, display summary statistics for rep78
        . by foreign:  summarize rep78

    Same as above command, but check that the data are sorted by foreign and make within foreign
        . by foreign (make):  summarize rep78
        not sorted
        r(5);
        . sort foreign make
        . by foreign (make): summarize rep78

    For each category of rep78, display frequency counts of foreign
        . by rep78: tabulate foreign
        not sorted
        r(5);
        . sort rep78
        . by rep78: tabulate foreign

    Equivalent to above two commands
        . by rep78, sort:  tabulate foreign

    Equivalent to above command
        . bysort rep78: tabulate foreign

    For each category of rep78 within categories of foreign, display summary statistics for price
        . by foreign rep78, sort: summarize price

    ------------------------------------------------------------------------------------------------------------------------------
    Setup
        . sysuse autornd
        . keep in 1/20

    Store in new variable mean_w the mean value of weight for each category of mpg
        . by mpg, sort: egen mean_w = mean(weight)
    ------------------------------------------------------------------------------------------------------------------------------


Technical note

    by repeats the stata_cmd for each group defined by varlist.  If stata_cmd saves results, only the results from the last
    group on which stata_cmd executes will be saved.

藤椅
蓝色 发表于 2013-6-9 00:20:12
看看 by的格式
不是放在后面

如果放在后面,你查那个命令会列出来的
这些问题,查命令的help就都知道了


Title

    [R] table -- Tables of summary statistics


Syntax

        table rowvar [colvar [supercolvar]] [if] [in] [weight] [, options]


    options                Description
    ----------------------------------------------------------------------------------------------------------------------------
    Main
      contents(clist)      contents of table cells; select up to five statistics; default is contents(freq)
      by(superrowvarlist)  superrow variables

    Options
      cellwidth(#)         cell width
      csepwidth(#)         column-separation width
      stubwidth(#)         stub width
      scsepwidth(#)        supercolumn-separation width
      center               center-align table cells; default is right-align
      left                 left-align table cells; default is right-align
      cw                   perform casewise deletion
      row                  add row totals
      col                  add column totals
      scol                 add supercolumn totals
      concise              suppress rows with all missing entries
      missing              show missing statistics with period
      replace              replace current data with table statistics
      name(string)         name new variables with prefix string
      format(%fmt)         display format for numbers in cells; default is format(%9.0g)
    ----------------------------------------------------------------------------------------------------------------------------
    by is allowed; see [D] by.
    fweights, aweights, iweights, and pweights are allowed; see weight.
    pweights may not be used with sd, semean, sebinomial, or sepoisson.  iweights may not be used with semean, sebinomial, or
      sepoisson.  aweights may not be used with sebinomial or sepoisson.

Setup
        . webuse byssin1

    Four-way table
        . table workplace smokes race [fw=pop], by(sex) c(mean prob) format(%9.3f)

    Four-way table with supercolumn, row, and column totals
        . table workplace smokes race [fw=pop], by(sex) c(mean prob) format(%9.3f) sc col row





板凳
chuchumaolunvzi 发表于 2013-6-9 15:35:05
蓝色 发表于 2013-6-9 00:15
Title

    [D] by -- Repeat Stata command on subsets of the data
哦,谢谢您的指点,我得再慢慢看看,还有您的建议!

报纸
连瑞毅 学生认证  发表于 2018-11-19 20:56:48
stata有问题直接help,他会有例子举出来的

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-11 17:10