{smcl} {* 28Jun2022}{...} {hline} help for {hi:greyra} {hline} {title:The Grey Relational Analysis (GRA)} {cmd:greyra} is a command about computing the grey relational degree. {marker syntax}{...} {title:Syntax} {p 4 32 2} {cmd:greyra} {varlist} {ifin}, [ {opt sc:ore(newvar)} {opt pr:efix(string)} {opt si:gma(#)} {opt un:des(varlist)} {opt b:y(varlist)} {opt g:eneral} {opt th:eta(#)} {opt sh:ift(#)} {opt sm:ooth(#)} {opt m:ean} {opt n:orm} {opt f:irst} {opt e:wm} {opt w:coef(numlist)} {opt re:c} {opt ba:se} {opt l:ist} {opt k:eep} ] {synoptset 15 tabbed}{...} {synopthdr} {synoptline} {synopt :{opt sc:ore(newvar)}}is optional, creats a new variable which is the evaluation result by GRA (based on id). The default newname is "{cmd:GRA_Score}".{p_end} {synopt :{opt pr:efix(newvar)}}is optional, supplies a prefix for new variables evaluated by GRA (based on varlist). The default prefix is "{cmd:GRA_}".{p_end} {synopt :{opt si:gma(#)}}is optional, assigns weight to Max-Max difference value, its range is [0, 1]. The default is {opt si:gma(0.5)}.{p_end} {synopt :{opt un:des(varlist)}}is optional, defines undesirable variable sets. These variables should be the subset of {varlist}.{p_end} {synopt :{opt b:y(varlist)}}is optional, defines group (time) variable(s). This option is applied to panel, longitudinal or multidimensional data.{p_end} {synopt :{opt g:eneral}}is optional, computes the generalized grey relational degree, including the absolute, relative and synthetic degree.{p_end} {synopt :{opt si:gma(#)}}is optional, assigns weight to the absolute grey relational degree, its range is [0, 1]. The default is {opt th:eta(0.5)}.{p_end} {synopt :{opt sh:ift(#)}}is optional, adds adds a number (range is {cmd:(0, 1}{res:]}). This option is not worked with option {opt sm:ooth(#)}, {opt m:ean}, {opt n:orm} or {opt f:irst}.{p_end} {synopt :{opt sm:ooth(#)}}is optional, smooths with a parameter (range is {cmd:(0, 1}{res:)}). The option isn't worked with option {opt sh:ift(#)}, {opt m:ean}, {opt n:orm} or {opt f:irst}.{p_end} {synopt :{opt m:ean}}is optional, uses meanization as dimensionless method. The default method of Basic GRA is {cmd:Min-Max} standardization.{p_end} {synopt :{opt n:orm}}is optional, uses normalization as dimensionless method. This option is not allowed to be used with option {opt m:ean} or {opt f:irst}.{p_end} {synopt :{opt f:irst}}is optional, uses initialization as dimensionless method. This option is not allowed to be used with option {opt m:ean} or {opt n:orm}.{p_end} {synopt :{opt e:wm}}is optional, uses the entropy weight to calculating the overall score by GRA. The default weight is {cmd:1}.{p_end} {synopt :{opt w:coef(numlist)}}is optional, uses the custom weight to calculating the overall score by GRA. This option is not allowed with option {opt e:wm}.{p_end} {synopt :{opt re:c}}is optional, computes the reciprocal when option {opt un:des(varlist)} and {{opt m:ean}, {opt n:orm} or {opt f:irst}} are set. The default is negative.{p_end} {synopt :{opt ba:se}}is optional, uses the maximum and minimum values of base period for standardization; must be set with {opt e:wm} and {opt b:y(varlist)}.{p_end} {synopt :{opt l:ist}}is optional, lists the specific grey relational degree variables of {varlist} (their suffixes are {cmd:_XI}).{p_end} {synopt :{opt k:eep}}is optional, keeps the specific grey relational degree variables of {varlist} (with suffixes as {cmd:_XI}). The default is dropped.{p_end} {synoptline} {p 4}{res:*** Important Notes:}{p_end} {p 4}1. The first variable of {varlist} is the {cmd:referential} sequence, and the other variables are the comparative sequences;{p_end} {p 4}2. The alternative dimensionless methods (such as {opt m:ean}, {opt n:orm}, and {opt f:irst}) used to basic GRA, must be one and only one specified;{p_end} {p 4}3. The default dimensionless method of generalized GRA is initialization (no need to choose), and alternative method is {opt m:ean};{p_end} {p 4}4. Generalized GRA generates three sets of variables, including the absolute, relative and synthetic degrees (with prefix {cmd:AGR_}, {cmd:RGR_}, {cmd:SGR_});{p_end} {p 4}5. If option {opt w:coef(#)} is set, the number and order of {varlist} (except the first variable) and {opt w:coef(#)} must be one-to-one correspondence;{p_end} {p 4}6. The command {cmd:greyra} may generate some variables named with prefixes or suffixes as follows:{p_end} {p 7}{cmd:GRA_ , AGR_ , RGR_ , SGR_ , _XI , _WXI , _ET ,} _RMAX , _RMIN , _MAXM , _MINM , _MEAN , _DFF , _NRM , _SD ,{p_end} {p 7}So, you should avoid to including variables names with these prefixes or suffixes.{p_end} {marker examples}{...} {title:Examples} {phang} 1. Basic grey relational analysis: {phang} {cmd: . greyra x1-x10, list} {phang} {cmd: . greyra x1-x10, list shift(0.01)} {phang} {cmd: . greyra x1-x10, first list} {phang} {cmd: . greyra x1-x10, first undes(x3 x6 x8) list rec} {phang} {cmd: . greyra x1-x10, mean undes(x3 x6 x8) list rec} {phang} 2. The grey relation analysis by entropy weights or custom weights: {phang} {cmd: . greyra x1-x10, ewm list} {phang} {cmd: . greyra x1-x10, ewm list smooth(0.01)} {phang} {cmd: . greyra x1-x4, sc(new_sc) pr(GR) undes(x3 x6 x8) wcoef(0.3 0.2 0.5) list} {phang} {cmd: . greyra x1-x4, sc(new_sc) pr(GR) undes(x3 x6 x8) wcoef(`=1/3' `=1/3' `=1/3') list} {phang} 3. Extended above command example: {phang} {cmd: . greyra x1-x10, sc(new_sc) pr(GR) undes(x3 x6 x8) list keep} {phang} {cmd: . greyra x1-x10, sc(new_sc) pr(GR) undes(x3 x6 x8) first list keep} {phang} {cmd: . greyra x1-x10, sc(new_sc) pr(GR) undes(x3 x6 x8) norm list keep} {phang} {cmd: . greyra x1-x10, sc(new_sc) pr(GR) undes(x3 x6 x8) mean list keep} {phang} 4. The generalized grey relational analysis: {phang} {cmd: . greyra x1-x10, sc(new_sc) pr(GR) general list keep} {phang} {cmd: . egen GGR_ind=rowtotal(*_SGR)} {space 4}// computing the sum of synthetic grey relational degree {phang} {cmd: . greyra x1-x10, sc(new_sc) pr(GR) general mean list keep} {phang} 5. Example of panel, longitudinal or multidimensional data: {phang} {cmd: . greyra x1-x10, by(year) list keep} {phang} 6. Calculating the grey relation entropy: {phang} {cmd: . greyra x1-x10, ewm list keep} {phang} {cmd: . greyra x1-x10, ewm by(year) list keep} {phang} {cmd: . greyra x1-x10, ewm by(year) base list keep} {phang} {cmd: . EWM *_XI, list} {title:Authors} {phang} {cmd:Dejin Xie}, School of Economics and Management, Nanchang University, China.{break} E-mail: {browse "mailto:xiedejin@ncu.edu.cn":xiedejin@ncu.edu.cn}. {break} {title:Also see} {p 4 14 2}Help: {helpb egen} ; {helpb ewm} (if installed).{p_end}