⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 corr2data.hlp

📁 是一个经济学管理应用软件 很难找的 但是经济学学生又必须用到
💻 HLP
字号:
{smcl}
{* 24feb2005}{...}
{cmd:help corr2data}{right:dialog:  {bf:{dialog corr2data}}}
{hline}

{title:Title}

{p2colset 5 22 24 2}{...}
{p2col :{hi:[D] corr2data} {hline 2}}Create dataset with specified
correlation structure{p_end}
{p2colreset}{...}


{title:Syntax}

{p 8 18 2}
{cmd:corr2data}
{it:{help varlist:newvarlist}}
[{cmd:,}
{it:options}]

{synoptset 23 tabbed}{...}
{synopthdr}
{synoptline}
{syntab :Main}
{synopt :{opt clear}}replace the current dataset{p_end}
{synopt :{opt d:ouble}}generate variable type as {opt double}; default is
{opt float}{p_end}
{synopt :{opt n(#)}}{it:#} of observations to be generated; default is current
number{p_end}
{synopt :{opt sd:s(vector)}}standard deviations of generated variables{p_end}
{synopt :{opt corr(matrix|vector)}}correlation matrix{p_end}
{synopt :{opt cov(matrix|vector)}}covariance matrix{p_end}
{synopt :{cmdab:cs:torage(}{cmdab:f:ull)}}correlation/covariance
structure is stored as a symmetric k*k matrix{p_end}
{synopt :{cmdab:cs:torage(}{cmdab:l:ower)}}correlation/covariance
structure is stored as a lower triangular matrix{p_end}
{synopt :{cmdab:cs:torage(}{cmdab:u:pper)}}correlation/covariance
structure is stored as an upper triangular matrix{p_end}
{synopt :{opt m:eans(vector)}}means of generated variables; default is
{cmd:means(0)}{p_end}

{syntab :Options}
{synopt :{opt seed(#)}}seed for random-number generator{p_end}
{synoptline}
{p2colreset}{...}


{title:Description}

{pstd}
{opt corr2data} adds new variables with specified correlation structures to
the existing dataset or creates a new dataset with a specified correlation
structure.  The purpose of this is to allow you to perform analyses from
summary statistics when summary statistics are all you know and summary
statistics are sufficient to obtain results.  For example, summary statistics
are sufficient for performing t-tests, anova, principal components,
regression, and factor analyses.

      {cmd:. clear}                             (clear memory)
      {cmd:. corr2data} ...{cmd:,} {opt n(#)} {opt cov(...)} ...  (create artificial data)
      {cmd:. regress} ...                       (use artificial data appropriately)

{pstd}
However, in the case of factor analyses and principal components, the commands
{cmd:factormat} and {cmd:pcamat} allow you to skip the step of using
{cmd:corr2data}; see {helpb factor} and {helpb pca}.

{pstd}
The data created by {cmd:corr2data} is artificial; it is not the original
data, and it is not a sample from an underlying population with the summary
statistics specified.  See {helpb drawnorm} if you want to generate a random
sample.  In a sample, the summary statistics will differ from the population
values and will differ from one sample to the next.

{pstd}
The dataset {cmd:corr2data} creates is suitable for one purpose only:
performing analyses when all that is known are summary statistics, and those
summary statistics are sufficient for the analysis at hand.  The artificial
data tricks the analysis command into producing the desired result.  The
analysis command, being by assumption only a function of the summary
statistics, extracts from the artificial data the summary statistics, which
are the same summary statistics you specified, and then makes its calculation
based on those statistics.


{title:Options}

{dlgtab:Main}

{phang}
{opt clear} specifies that it is okay to replace the dataset in memory,
even though the current dataset has not been saved on disk.

{phang}
{opt double} specifies that the new variables be stored as Stata
{opt double}s, meaning 8-byte reals.  If {opt double} is not specified,
variables are stored as {opt float}s, meaning 4-byte reals.  See 
{help data types}.

{phang}
{opt n(#)} specifies the number of observations to be
generated; the default
is the current number of observations.  If {opt n(#)} is not specified or
is the same as the current number of observations, {opt corr2data}
adds the new variables to the existing dataset; otherwise, {opt corr2data}
replaces the dataset in memory.

{phang}{opt sds(vector)} specifies the standard deviations of the
generated variables.  {opt sds()} may not be specified with {opt cov()}.

{phang}
{opt corr(matrix|vector)}
specifies the correlation matrix.
If neither {opt corr()} nor {opt cov()} is specified,
the default is orthogonal data.

{phang}
{opt cov(matrix|vector)} specifies the covariance matrix.
If neither {opt corr()} nor {opt cov()} is specified,
the default is orthogonal data.

{phang}
{cmd:cstorage(full}|{cmd:lower}|{cmd:upper)}
specifies the storage mode for the correlation or covariance structure in
{opt corr()} or {opt cov()}.  The following storage modes are supported:

{pmore}
{opt full} specifies that the correlation or covariance structure
is stored (recorded) as a symmetric k*k matrix.

{pmore}
{opt lower} specifies that the correlation or covariance structure is recorded
as a lower triangular matrix.  With k variables, the
matrix should have k(k+1)/2 elements in the following order:

{p 16 20 2}
C(11) C(21) C(22) C(31) C(32) C(33) ... C(k1) C(k2) ... C(kk)

{pmore}
{opt upper} specifies that the correlation or covariance structure is recorded
as an upper triangular matrix.  With k variables, the
matrix should have k(k+1)/2 elements in the following order:

{p 16 20 2}
C(11) C(12) (C13) ... C(1k) C(22) C(23) ... C(2k) ...
C(k-1k-1) C(k-1k) C(kk)

{pmore}
Specifying {cmd:cstorage(full)} is optional if the matrix is square.
{cmd:cstorage(lower)} or {cmd:cstorage(upper)} is required for the vectorized
storage methods.  See {help storage modes} for examples.

{phang}
{opt means(vector)} specifies the means of the generated variables.
The default is {cmd:means(0)}.

{dlgtab:Options}

{phang}
{opt seed(#)}
specifies the seed of the random-number generator used to generate
data.  {it:#} defaults to 0.  The random numbers generated inside
{opt corr2data} do not affect the seed of the standard random-number generator.


{title:Examples}

{phang}{cmd:. corr2data x y, n(2000) means(2 3) sds(.5 2)}{p_end}
{phang}{cmd:. summarize}{p_end}

{phang}{cmd:. matrix C = (1, .5 \ .5, 1)}{p_end}
{phang}{cmd:. corr2data x y, n(2000) corr(C)}{p_end}
{phang}{cmd:. correlate x y}{p_end}


{title:Also see}

{psee}
Manual:  {bf:[D] corr2data}

{psee}
Online:  {helpb drawnorm}, {help data types}
{p_end}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -