تبليغاتX
stat











 Syntax پنجشنبه ششم تیر 1387 2:3

                                              Syntax

 

The following statements are available in PROC GLM

.

PROC GLM < options > ;

CLASS variables ;

MODEL dependents=independents < / options > ;

ABSORB variables ;

BY variables ;

FREQ variable ;

ID variables ;

WEIGHT variable ;

CONTRAST 'label' effect values < ... effect values > < / options > ;

ESTIMATE 'label' effect values < ... effect values > < / options > ;

LSMEANS effects < / options > ;

MANOVA < test-options >< / detail-options > ;

MEANS effects < / options > ;

OUTPUT < OUT=SAS-data-set >

      keyword=names < ... keyword=names > < / option > ;

RANDOM effects < / options > ;

REPEATED factor-specification < / options > ;

TEST < H=effects > E=effect < / options > ; Although there are numerous statements and options available in PROC GLM, many applications use only a few of them. Often you can find the features you need by looking at an example or by quickly scanning through this section.

To use PROC GLM, the PROC GLM and MODEL statements are required. You can specify only one MODEL statement (in contrast to the REG procedure, for example, which allows several MODEL statements in the same PROC REG run). If your model contains classification effects, the classification variables must be listed in a CLASS statement, and the CLASS statement must appear before the MODEL statement. In addition, if you use a CONTRAST statement in combination with a MANOVA, RANDOM, REPEATED, or TEST statement, the CONTRAST statement must be entered first in order for the contrast to be included in the MANOVA, RANDOM, REPEATED, or TEST analysis.

The following table summarizes the positional requirements for the statements in the GLM procedure.

Table 30.1: Positional Requirements for PROC GLM Statements

Statement

 

Must Appear Before the

 

Must Appear After the

ABSORB

 

first RUN statement

 

 

BY

 

first RUN statement

 

 

CLASS

 

MODEL statement

 

 

CONTRAST

 

MANOVA, REPEATED,

 

MODEL statement

 

 

or RANDOM statement

 

 

ESTIMATE

 

 

 

MODEL statement

FREQ

 

first RUN statement

 

 

ID

 

first RUN statement

 

 

LSMEANS

 

 

 

MODEL statement

MANOVA

 

 

 

CONTRAST or

 

 

 

 

MODEL statement

MEANS

 

 

 

MODEL statement

MODEL

 

CONTRAST, ESTIMATE,

 

CLASS statement

 

 

LSMEANS, or MEANS

 

 

 

 

statement

 

 

OUTPUT

 

 

 

MODEL statement

RANDOM

 

 

 

CONTRAST or

 

 

 

 

MODEL statement

REPEATED

 

 

 

CONTRAST, MODEL,

 

 

 

 

or TEST statement

TEST

 

MANOVA or

 

MODEL statement

 

 

REPEATED statement

 

 

WEIGHT

 

first RUN statement

 

 

The following table summarizes the function of each statement (other than the PROC statement) in the GLM procedure:

Table 30.2: Statements in the GLM Procedure

Statement

Description

ABSORB

absorbs classification effects in a model

BY

specifies variables to define subgroups for the analysis

CLASS

declares classification variables

CONTRAST

constructs and tests linear functions of the parameters

ESTIMATE

estimates linear functions of the parameters

FREQ

specifies a frequency variable

ID

identifies observations on output

LSMEANS

computes least-squares (marginal) means

MANOVA

performs a multivariate analysis of variance

MEANS

computes and optionally compares arithmetic means

MODEL

defines the model to be fit

OUTPUT

requests an output data set containing diagnostics for each observation

RANDOM

declares certain effects to be random and computes expected mean squares

REPEATED

performs multivariate and univariate repeated measures analysis of variance

TEST

constructs tests using the sums of squares for effects and the error term you specify

WEIGHT

specifies a variable for weighting observations

 

نوشته شده توسط mostafa | لينک ثابت | موضوع: |

 CONTRAST Statement چهارشنبه پنجم تیر 1387 3:7

CONTRAST Statement

CONTRAST 'label' effect values < ... effect values > < / options > ;

The CONTRAST statement enables you to perform custom hypothesis tests by specifying an L vector or matrix for testing the univariate hypothesis or the multivariate hypothesis L B M = 0. Thus, to use this feature you must be familiar with the details of the model parameterization that PROC GLM uses. For more information, see the"Parameterization of PROC GLM Models" section. All of the elements of the L vector may be given, or if only certain portions of the L vector are given, the remaining elements are constructed by PROC GLM from the context (in a manner similar to rule 4 discussed in the  "Construction of Least-Squares Means" section). There is no limit to the number of CONTRAST statements you can specify, but they must appear after the MODEL statement. In addition, if you use a CONTRAST statement and a MANOVA, REPEATED, or TEST statement, appropriate tests for contrasts are carried out as part of the MANOVA, REPEATED, or TEST analysis. If you use a CONTRAST statement and a RANDOM statement, the expected mean square of the contrast is displayed. As a result of these additional analyses, the CONTRAST statement must appear before the MANOVA, REPEATED, RANDOM, or TEST statement.

In the CONTRAST statement,

label

identifies the contrast on the output. A label is required for every contrast specified. Labels must be enclosed in quotes.

effect     

identifies an effect that appears in the MODEL statement, or the INTERCEPT effect. The INTERCEPT effect can be used when an intercept is fitted in the model. You do not need to include all effects that are in the MODEL statement.

values

are constants that are elements of the L vector associated with the effect.


You can specify the following options in the CONTRAST statement after a slash(/):

E

displays the entire L vector. This option is useful in confirming the ordering of parameters for specifying L.

E=effect

specifies an error term, which must be one of the effects in the model. The procedure uses this effect as the denominator in F tests in univariate analysis. In addition, if you use a MANOVA or REPEATED statement, the procedure uses the effect specified by the E= option as the basis of the E matrix. By default, the procedure uses the overall residual or error mean square (MSE) as an error term.

ETYPE=n

specifies the type (1, 2, 3, or 4, corresponding to Type I, II, III, and IV tests, respectively) of the E= effect. If the E= option is specified and the ETYPE= option is not, the procedure uses the highest type computed in the analysis.

SINGULAR=number

checking (GLM) tunes the estimability checking. If ABS(L-LH) > C×number for any row in the contrast, then L is declared nonestimable. H is the (X'X)-X'X matrix, and C is ABS(L) except for rows where L is zero, and then it is 1. The default value for the SINGULAR= option is 10-4. Values for the SINGULAR= option must be between 0 and 1.

As stated previously, the CONTRAST statement enables you to perform custom hypothesis tests. If the hypothesis is testable in the univariate case, SS(
) is computed as

(Lb)'(L(X'X)- L')-1(Lb)


where b = (X'X)-X'y. This is the sum of squares displayed on the analysis-of-variance table.

For multivariate testable hypotheses, the usual multivariate tests are performed using

H = M'(LB)' (L(X'X)- L')-1 (LB)M


where B = (X'X)-X'Y and Y is the matrix of multivariate responses or dependent variables. The degrees of freedom associated with the hypothesis is equal to the row rank of L. The sum of squares computed in this situation are equivalent to the sum of squares computed using an L matrix with any row deleted that is a linear combination of previous rows.

Multiple-degree-of-freedom hypotheses can be specified by separating the rows of the L matrix with commas.

For example, for the model

   proc glm;

      class A B;

      model Y=A B;

   run;



with A at 5 levels and B at 2 levels, the parameter vector is


To test the hypothesis that the pooled A linear and A quadratic effect is zero, you can use the following L matrix:


The corresponding CONTRAST statement is

   contrast 'A LINEAR & QUADRATIC'

            a -2 -1  0  1  2,

            a  2 -1 -2 -1  2;



If the first level of A is a control level and you want a test of control versus others, you can use this statement:

   contrast 'CONTROL VS OTHERS'  a -1 0.25 0.25 0.25 0.25;

 

نوشته شده توسط mostafa | لينک ثابت | موضوع: |

 نقش آمار در مراحل اساسی پژوهش علمی چهارشنبه پنجم تیر 1387 3:1

نقش آمار در مراحل اساسی پژوهش علمی

در مرحله جمع آوری اطلاعات ، آمار راهنمای محقق در انتخاب روشها و وسایل مناسب برای جمع آوری    داده‌های اطلاعاتی است. این راهنمایی ، مشتمل است بر تعیین نوع و میزان داده‌ها. بطوری که نتیجه‌های        حاصل از تجزیه و تحلیل داده‌ها را بتوان با درجه دقت مورد نظر بیان کرد. در زمینه‌هایی از مطالعات که   انجام آزمایشها پرخرج است، نوع و مقدار داده‌های لازم برای بدست آوردن نتیجه‌هایی که از میزان اعتبار مطلوب برخوردار باشند، باید به دقت از قبل تعیین شود. در زمینه‌های دیگر نیز ، این امر از لحاظ اعتبار نهایی و موثر بودن نتایج حاصل از تحلیل داده‌ها ، اهمیت دارد. شاخه‌ای از آمار که با طرح ریزی آزمایشها و گردآوری داده‌ها سروکار دارد، طرح آزمایش یاطرح نمونه گیری نامیده می‌شود               .                            
در مراحل بعد از گردآوری داده‌ها ، نیاز بیشتری به روشهای آماری وجود دارد. دسته‌ای از این روشها برای خلاصه کردن اطلاعات موجود در داده‌ها طرح ریزی می‌شوند تا توجه ما روی ویژگیهای مهم داده‌ها متمرکز گردد و جزئیات غیر ضروری کنار گذاشته شوند. دسته مهمتری از روشها ، در تجزیه و تحلیل داده‌ها ، برای استخراج نکات کلی و استنباطهایی درباره پدیده تحت مطالعه بکار می‌روند. آن دسته از روشهای آماری که با تلخیص و توصیف ویژگیهای برجسته داده‌ها سروکار دارند، در مبحث آمار توصیفی   قرار می‌گیرند. برخلاف گذشته ، امروزه آمار توصیفی فقط قسمت کوچکی از حوزه فعالیتهایی است که تحت پوشش موضوع آمار قرار می‌گیرند                                                                                                                         .     
در زمان حاضر ، قسمت عمده موضوع آمار عبارت است از کسب اطلاعات با انجام محاسباتی روی داده‌ها ، و ارزیابی معلومات تازه‌ای که از این اطلاعات بدست می‌آید. این قسمت از قلمرو آمار را آمار استنباطی و روشهای مربوط به آن را استنباط آماری می‌نامند. استفاده از این روشها پایه‌ای برای استدلال بدست می‌دهد تا بتوانیم واقعیات مشاهده شده را بطور منطقی تعبیر نماییم، تعیین کنیم که این واقعیات تا چه حدی مدل مفروضی را تایید یا آن را نقض می‌کنند. و پیشنهادهایی برای اصلاح نظریه موجود ، و یا شاهد طرح ریزی تحقیقات دیگری ارائه دهیم.

نقش آمار در تحقیقات اجتماعی- اقتصادی

در بسیاری از قلمروهای جامعه شناسی ، اقتصاد ، علوم سیاسی ، مطالعاتی در زمینه‌های مربوط به رفاه اقتصادی گروههای قومی گوناگون ، هزینه‌های مصرف کنندگان در سطوح مختلف درآمد و