Top Banner
ASReml workshop 1.0 Course CD – Installation Arthur Gilmour Armidale Animal Breeding Summer Course AABSC 2005 – p. 1
71

Arthur Gilmour - jvanderw.une.edu.au

Mar 13, 2022

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Arthur Gilmour - jvanderw.une.edu.au

ASReml workshop

1.0 Course CD – Installation

Arthur Gilmour

Armidale Animal Breeding Summer Course AABSC 2005 – p. 1

Page 2: Arthur Gilmour - jvanderw.une.edu.au

asrwin110.exe

Run this first. It uses InstallShield to set upthe ASReml directory structure and fileassociations.

Installs ASReml 1.10 asC:\Program Files\ASReml\bin\asreml.exe

I suggest you rename asreml.exe toasreml110a.exe

Armidale Animal Breeding Summer Course AABSC 2005 – p. 2

Page 3: Arthur Gilmour - jvanderw.une.edu.au

bin directory

contains asreml110h.exe andasreml162zb.exe

Copy the directory contents toC:\Program Files\ASReml\bin

This is the latest builds of 1.10 and and 1.62.

Copy asreml162zb.exe as asreml.exe sothat it is the default version.

Armidale Animal Breeding Summer Course AABSC 2005 – p. 3

Page 4: Arthur Gilmour - jvanderw.une.edu.au

Documentation

There are two ASReml documents. The UserGuide relates to version 1.00. The ReferenceManual has been updated to reflect 1.62 butis not as easy to use.

Place these in the Doc directory

Copy the workshop notes into a Workshopdirectory

Copy the Exercises into an Exercisesdirectory.

Armidale Animal Breeding Summer Course AABSC 2005 – p. 4

Page 5: Arthur Gilmour - jvanderw.une.edu.au

WinEdt or ConText

ConText is simpler to set up and free

WinEdt allows reviewing Postscript graph filesif GSVIEW is also installed.

Armidale Animal Breeding Summer Course AABSC 2005 – p. 5

Page 6: Arthur Gilmour - jvanderw.une.edu.au

Context

http://www.context.cx/

Run ContextSetup.exe from the CDCopy ASReml.chl toC:\Program Files\Context\Highlighters

Armidale Animal Breeding Summer Course AABSC 2005 – p. 6

Page 7: Arthur Gilmour - jvanderw.une.edu.au

Context: AttachASReml

<Options> <Environment Options>

<Execute keys>

<Add> file extentions .as, .asr<F9>Execute"C:\Program files\ASReml\bin\asreml.exe"

Start In %p, Parameters %f, Hint Asreml<Add> file extentions .pin<F9>Execute"C:\Program files\ASReml\bin\asreml.exe"

Start In %p, Parameters -p %f, HintPIN file

Armidale Animal Breeding Summer Course AABSC 2005 – p. 7

Page 8: Arthur Gilmour - jvanderw.une.edu.au

Attach UserGuide

<F12>Execute <ADOBE ACROBAT PATH>

Start In %p, Parameters"C:\Program files\ASReml\doc\UserGuide.pdf"

Find <ADOBE ACROBAT PATH> by rightclicking the ADOBE READER icon andselecting <Properties>

Armidale Animal Breeding Summer Course AABSC 2005 – p. 8

Page 9: Arthur Gilmour - jvanderw.une.edu.au

WinEdt

WinEdt is a Third Party Shareware Editoravailable from http://www.winedt.comespecially suited to Windows XP.

30 day Demo license; thence USD40

Teach it to run ASReml:<Options> <Menu Setup>DoubleClick <&Accessories> in ’popups’ listCursor down to Run and Left ClickRightClick to insert a new Macro

Armidale Animal Breeding Summer Course AABSC 2005 – p. 9

Page 10: Arthur Gilmour - jvanderw.une.edu.au

Fill in fields

Menu Item: &ASReml

Macro:Run(|"C:\Program Files\ASReml\

bin\ASReml.exe" "%N".as,|, "%P");

Start In: %P

ShortCut: ’Ctrl+Shft+A’ (or P or Z)

Allocate a button and add ASReml to thetoolbar.

Build a submenu to invoke ASReml differentways

Armidale Animal Breeding Summer Course AABSC 2005 – p. 10

Page 11: Arthur Gilmour - jvanderw.une.edu.au

Example

Armidale Animal Breeding Summer Course AABSC 2005 – p. 11

Page 12: Arthur Gilmour - jvanderw.une.edu.au

ASReml workshop

1.1 Getting Started with ASReml

Arthur Gilmour

Armidale Animal Breeding Summer Course AABSC 2005 – p. 12

Page 13: Arthur Gilmour - jvanderw.une.edu.au

Why start?Why am I here?

You understand the principles of linear mixedmodels

You want a flexible and comprehensiveprogram to fit them.

You are paying. What do you expect?

Armidale Animal Breeding Summer Course AABSC 2005 – p. 13

Page 14: Arthur Gilmour - jvanderw.une.edu.au

The focus of thisworkshop

Principles for using ASReml.

Animal breeding applications?

Exploring variance modelling issues?

Armidale Animal Breeding Summer Course AABSC 2005 – p. 14

Page 15: Arthur Gilmour - jvanderw.une.edu.au

Today

Mechanics of running ASReml

Basic principles

Armidale Animal Breeding Summer Course AABSC 2005 – p. 15

Page 16: Arthur Gilmour - jvanderw.une.edu.au

Rest of Week

Animal models

Multivariate Modelling

Repeated measures

Prediction and Testing

Armidale Animal Breeding Summer Course AABSC 2005 – p. 16

Page 17: Arthur Gilmour - jvanderw.une.edu.au

Getting ASReml

http://www.asreml.co.uk

Windows version has automatic 30day demolicense.

Other versions: license available on request.mailto:[email protected]

Current release version 1.10h

Workshop version 1.62zb fromhttp://www.asreml.co.uk/download-beta

1.62 is a beta version: Release 2 due in 2005.Armidale Animal Breeding Summer Course AABSC 2005 – p. 17

Page 18: Arthur Gilmour - jvanderw.une.edu.au

Licensing

VSN-International

Support sold separately

Armidale Animal Breeding Summer Course AABSC 2005 – p. 18

Page 19: Arthur Gilmour - jvanderw.une.edu.au

Documentation

User Guide (1.00)

Reference manual (1.62)

Examples

Cookbook

Armidale Animal Breeding Summer Course AABSC 2005 – p. 19

Page 20: Arthur Gilmour - jvanderw.une.edu.au

Installation(Windows)

InstallShield

C:\Program Files\ASRemlbin contains programdoc contains pdf manualexamples contains examples

Armidale Animal Breeding Summer Course AABSC 2005 – p. 20

Page 21: Arthur Gilmour - jvanderw.une.edu.au

A batch process

ASReml is not a typical Windows application

Run from Windows Explorer or CommandPrompt (DOS Box) or customizedWinEdt/ConText

There is a basic Menu mode for simple jobs.

Armidale Animal Breeding Summer Course AABSC 2005 – p. 21

Page 22: Arthur Gilmour - jvanderw.une.edu.au

How it works.

Identify problem

Collect and organise data: save as ASCII(.txt, .csv, .asd) file

Prepare .as job file (Notepad, WinEdt,ConText, TextEdit)

Run, Review, Revise, Rerun cycle

Report

Armidale Animal Breeding Summer Course AABSC 2005 – p. 22

Page 23: Arthur Gilmour - jvanderw.une.edu.au

Zinc example

View Data

Fit oneway analysis of variance to SeedZn

View running

View output

Armidale Animal Breeding Summer Course AABSC 2005 – p. 23

Page 24: Arthur Gilmour - jvanderw.une.edu.au

Zinc data

Source SeedZn LeafZn1 61 24.11 63 23.82 51 16.02 64 19.06 69 22.6

Armidale Animal Breeding Summer Course AABSC 2005 – p. 24

Page 25: Arthur Gilmour - jvanderw.une.edu.au

Zinc.as file

Zinc concentration study

Armidale Animal Breeding Summer Course AABSC 2005 – p. 25

Page 26: Arthur Gilmour - jvanderw.une.edu.au

Zinc.as file

Zinc concentration studySource * SeedZn LeafZn

cfSource SeedZn LeafZn1 61 24.11 63 23.82 51 16.02 64 19.06 69 22.6

Armidale Animal Breeding Summer Course AABSC 2005 – p. 26

Page 27: Arthur Gilmour - jvanderw.une.edu.au

Zinc.as file

Zinc concentration studySource * SeedZn LeafZn

ZINC.DAT !Skip 1

Armidale Animal Breeding Summer Course AABSC 2005 – p. 27

Page 28: Arthur Gilmour - jvanderw.une.edu.au

Zinc.as file

Zinc concentration studySource * SeedZn LeafZn

ZINC.DAT !Skip 1SeedZn ˜ mu Source

Armidale Animal Breeding Summer Course AABSC 2005 – p. 28

Page 29: Arthur Gilmour - jvanderw.une.edu.au

Zinc.as file

Zinc concentration studySource * SeedZn LeafZn

ZINC.DAT !Skip 1SeedZn ˜ mu Source

Run the job from command prompt, Exploreror WinEdt."C:\Program Files\ASReml\bin\ASReml.exe" ZINC

Armidale Animal Breeding Summer Course AABSC 2005 – p. 29

Page 30: Arthur Gilmour - jvanderw.une.edu.au

Automatic plot ofresiduals

Zinc concentration study Residuals vs Fitted values Residuals (Y)−10.00:14.00 Fitted values (X) 31.33: 83.67

Armidale Animal Breeding Summer Course AABSC 2005 – p. 30

Page 31: Arthur Gilmour - jvanderw.une.edu.au

View zinc.asr

ASReml 1.63i [07 Jan 2005] Zinc concentration study

17 Jan 2005 12:23:06.591 32.00 Mbyte Windows zinc

This Beta version is valid for 5 months from 07 Jan 2005

Please send comments/queries to [email protected]

Licensed to: Arthur Gilmour

***********************************************************

* SYNTAX change: A/B now means A A.B *

* *

* Contact [email protected] for licensing and support *

***************************************************** ARG *

Armidale Animal Breeding Summer Course AABSC 2005 – p. 31

Page 32: Arthur Gilmour - jvanderw.une.edu.au

Data summary

Folder: C:\data\Prosper\Armidale2005

QUALIFIERS: !SKIP 1

Reading ZINC.DAT FREE FORMAT skipping 1 lines

Univariate analysis of SeedZn

Using 39 records of 39 read

Model term Size #miss #zero MinNon0 Mean MaxNon0

1 Source 24 0 0 1 11.9487 24

2 SeedZn Variate 0 0 29.00 60.10 93.00

3 LeafZn 0 0 10.20 19.84 35.40

4 mu 1

Armidale Animal Breeding Summer Course AABSC 2005 – p. 32

Page 33: Arthur Gilmour - jvanderw.une.edu.au

Iteration sequence

Forming 25 equations: 25 dense.

Initial updates will be shrunk by factor 0.316

NOTICE: 10 singularities detected.

1 LogL=-64.4770 S2= 44.160 24 df 1.000

2 LogL=-64.4770 S2= 44.160 24 df 1.000

Final parameter values 1.000

Armidale Animal Breeding Summer Course AABSC 2005 – p. 33

Page 34: Arthur Gilmour - jvanderw.une.edu.au

Result summary

Degrees of Freedom and Stratum Variances

24.00 44.1597 1.0

Source Model terms Gamma Component Comp/SE % C

Variance 39 241.00000 44.1597 3.46 0 P

Analysis of Var NumDF DenDF F-incr Prob

4 mu 1 24.0 3190.25 <.001

1 Source 14 24.0 12.94 <.001

WARNING: The DenDF values are calculated ignoring fixed/boundary/singular

variance parameters and may change with the order of fitting.

SLOPES FOR LOG(ABS(RES)) on LOG(PV) for Section 1

0.50

Finished: 17 Jan 2005 12:23:08.854 LogL ConvergedArmidale Animal Breeding Summer Course AABSC 2005 – p. 34

Page 35: Arthur Gilmour - jvanderw.une.edu.au

ASReml workshop

1.2 Overview

Arthur Gilmour

Armidale Animal Breeding Summer Course AABSC 2005 – p. 35

Page 36: Arthur Gilmour - jvanderw.une.edu.au

A Structured .as file

First part defines the data

Second part defines the analysis

A minimal job has 4 lines

Many jobs have over 20 lines

File is built up in stages

Armidale Animal Breeding Summer Course AABSC 2005 – p. 36

Page 37: Arthur Gilmour - jvanderw.une.edu.au

Definition part

[Job qualifiers] (command line options)

Job Title

Data Definition

[Pedigree and GIV Files]

Data file name and qualifiersZinc data analysisSource * SeedZn LeafZn

ZINC.DAT !SKIP 1

Armidale Animal Breeding Summer Course AABSC 2005 – p. 37

Page 38: Arthur Gilmour - jvanderw.une.edu.au

Analysis part

[Analysis qualifiers]

[TABULATE]

Model lineSeedZn ˜ mu Source

[PREDICT]

[Variance structures]

[Component constraints]

Armidale Animal Breeding Summer Course AABSC 2005 – p. 38

Page 39: Arthur Gilmour - jvanderw.une.edu.au

Job qualifiers

command line optionsASReml -<options> <jobname> <arguments>

command line not easily modified underWindows

First line of job

Recognised by ! character

!-<options> <arguments> or<qualifiers>

Armidale Animal Breeding Summer Course AABSC 2005 – p. 39

Page 40: Arthur Gilmour - jvanderw.une.edu.au

Qualifier SYNTAX

First character is !

Three letters sufficient

separate from arguments with a space

Context specific

Examples!SKIP 1!CONTINUE !EPS !WORKSPACE 512

Armidale Animal Breeding Summer Course AABSC 2005 – p. 40

Page 41: Arthur Gilmour - jvanderw.une.edu.au

Common Jobqualifiers

!CONTINUE – Use parameter estimates froma previous run as starting values

!FINAL – One more iteration

!LOGFILE – write .asl file

!EPS – graphics to .eps file

!HARDCOPY – do not write graphics to screen

!NOGRAPHICS – do not create graphics at all

!WORKSPACE 512 – use 512 Mb workspace

!REPEAT r – rerun job with argumentsArmidale Animal Breeding Summer Course AABSC 2005 – p. 41

Page 42: Arthur Gilmour - jvanderw.une.edu.au

Job controlcontinued

M (Menumode) and P (Pinfile mode) must bespecified from the command lineASReml -M zincASReml -Pmyjob mypin

Command line options and argumentsoverride qualifiers and arguments on the jobcontrol line.

Armidale Animal Breeding Summer Course AABSC 2005 – p. 42

Page 43: Arthur Gilmour - jvanderw.une.edu.au

Arguments

A way of resetting options within a job

Are inserted into the job where $n appears:$1 is replaced by the first argument$2 is replaced by the second argument

With !REPEAT n, the first n arguments arebuilt into the output filename, and, the job isrun repeatedly after moving up anyarguments after the nthASReml -r2 job alpha beta gammaASReml -r2 job alpha betaASReml -r2 job alpha gammaArmidale Animal Breeding Summer Course AABSC 2005 – p. 43

Page 44: Arthur Gilmour - jvanderw.une.edu.au

Title Line

identifies the job

must be present

Armidale Animal Breeding Summer Course AABSC 2005 – p. 44

Page 45: Arthur Gilmour - jvanderw.une.edu.au

Comments

On all lines, characters following # arestripped out

Comment lines (a ! in column 1 followed by aspace) are copied to the output file.

Line length is 2000 characters in 1.62

Reserved characters: #, !, $

Armidale Animal Breeding Summer Course AABSC 2005 – p. 45

Page 46: Arthur Gilmour - jvanderw.une.edu.au

Data definition

Controls reading the data file and how thedata fields are used in the analysis.

definitions should appear in the order of thedata in the file

definition lines should be indented

transformations may alter the fields;the label will apply to the transformed field.

all data is held as real numbers.

Armidale Animal Breeding Summer Course AABSC 2005 – p. 46

Page 47: Arthur Gilmour - jvanderw.une.edu.au

Basic definitions

label (co)variate

label * simple factor coded 1 2 ...

label !A [n] alphabeticly coded factor

label !I [n] numerically coded factor

label !G n group of n variates

label !P pedigree factor

label !L list simple factor; levels namedSEX !L male female 1 codes for male

Armidale Animal Breeding Summer Course AABSC 2005 – p. 47

Page 48: Arthur Gilmour - jvanderw.une.edu.au

Zinc example

SeedZn is interpreted as a (co)variate

Source * generates 24 levels 1:2, 5:8,11:14, 17:19 21, 24

Source 24 generates 24 levels 1:2, 5:8,11:14, 17:19 21, 24

Armidale Animal Breeding Summer Course AABSC 2005 – p. 48

Page 49: Arthur Gilmour - jvanderw.une.edu.au

Recoding levels

Source !I generates 15 levels labelled1:2, 5:8, 11:14, 17:19 21, 24

Source !A generates 15 levels labelled1:2, 5:8, 11:14, 17:19 21, 24

Specify an indication of how many levels areexpected after !I and !A if there are many(> 1000) levels

Armidale Animal Breeding Summer Course AABSC 2005 – p. 49

Page 50: Arthur Gilmour - jvanderw.une.edu.au

Data qualifiers

!LL n – sets character length of alphbeticlabels

!SORT – puts labels in alphabetic/numericorder (current term)

!SORTALL – puts labels in alphabetic/numericorder (current and subsequent terms)

!SKIP s – to skip s fields

Armidale Animal Breeding Summer Course AABSC 2005 – p. 50

Page 51: Arthur Gilmour - jvanderw.une.edu.au

Transformations

applied in order of definition.

!D v – discards records with MV or v incurrent field

!M v – converts values of v to missing valuesin current field

yield !*100

Armidale Animal Breeding Summer Course AABSC 2005 – p. 51

Page 52: Arthur Gilmour - jvanderw.une.edu.au

ASReml workshop

1.3 Pedigree, giv and data files

Arthur Gilmour

Armidale Animal Breeding Summer Course AABSC 2005 – p. 52

Page 53: Arthur Gilmour - jvanderw.une.edu.au

Pedigree file

Expected if !P data qualifier specified

contains ID SIREID DAMID

in birth order (parents before progeny (see!SORT))

!ALPHA !SKIP k !DIAG !GIV !INBRED !MGS!REPEAT !SELF !SORT

e.g.mydata.ped !skip 1 !diag

Armidale Animal Breeding Summer Course AABSC 2005 – p. 53

Page 54: Arthur Gilmour - jvanderw.une.edu.au

GIV files

Generalized InVerse

Has file extension .giv ( .grm if not inverted)

Lower triangle rowwise sparse formatrow column value

!SKIP s

Armidale Animal Breeding Summer Course AABSC 2005 – p. 54

Page 55: Arthur Gilmour - jvanderw.une.edu.au

DataFile Line

names the data file (enclosed in quotes ifembedded blanks)

Data file is typically an ASCII fileTAB, SPACE or COMMA separatede.g. save from Excel as comma separated

Missing values: *, . and NA and empty fieldsin .csv file are taken as missing

!SKIP s !FILTER f !SELECT v !SUMMARY

zinc.dat !skip 1 !SUM

Armidale Animal Breeding Summer Course AABSC 2005 – p. 55

Page 56: Arthur Gilmour - jvanderw.une.edu.au

DataFile LineQualifiers

Some 40 qualifiers are defined for this line orto immediately follow this line.!MAXIT m !EPS !CONTINUE!X x !Y y !JOIN !G g

!CONTRAST t f coefficients!PVAL f points!SPLINE t points

Armidale Animal Breeding Summer Course AABSC 2005 – p. 56

Page 57: Arthur Gilmour - jvanderw.une.edu.au

ASReml workshop

1.4 Model line

Arthur Gilmour

Armidale Animal Breeding Summer Course AABSC 2005 – p. 57

Page 58: Arthur Gilmour - jvanderw.une.edu.au

TABULATE directiveRaw tables of means

y ˜ factors

Qualifiers!COUNT – numbers in each cell!SD – Standard deviation in each cell!RANGE – of values in each cell!STATS – same as !COUNT !RANGE !SD

before model in 1.62, after in 1.10, 1.62

TABULATE Leaf Seed ˜ Source !STATS

Multiple statements allowedArmidale Animal Breeding Summer Course AABSC 2005 – p. 58

Page 59: Arthur Gilmour - jvanderw.une.edu.au

Model line

Univariatey ˜ <fixed dense>,

!r <random sparse>,!f <fixed sparse>

y is response variable<fixed dense> terms appear in ANOVA table<random sparse> and <fixed sparse> arereordered to maximize sparsity duringsolution.

Armidale Animal Breeding Summer Course AABSC 2005 – p. 59

Page 60: Arthur Gilmour - jvanderw.une.edu.au

Model terms

Reserved termsmu – constant termmv – missing value estimatesunits – extra residual

Data terms e.g. A B X Sex Treatment

Functions of termsat(Group,1) spl(X,10) fac(X)log(X,1) forms log(X+1)

Armidale Animal Breeding Summer Course AABSC 2005 – p. 60

Page 61: Arthur Gilmour - jvanderw.une.edu.au

Model termscontinued

CombinationsA.B Sex.spl(X,5) at(site,3,5).row

ShorthandA*B – A B A.BA/B – A A.B

Continuation of a model line is indicated by atrailing comma

Armidale Animal Breeding Summer Course AABSC 2005 – p. 61

Page 62: Arthur Gilmour - jvanderw.une.edu.au

Random terms

May be followed by an initial value for thevariance component and a qualifier.

Default initial value is 0.1

blocks 0.2 !GU!GP – force positive (default)!GU – unrestricted!GF – fixed

Armidale Animal Breeding Summer Course AABSC 2005 – p. 62

Page 63: Arthur Gilmour - jvanderw.une.edu.au

PREDICT

Multiple predict statementspredict A

More details later

Variance structure lines

See later

Armidale Animal Breeding Summer Course AABSC 2005 – p. 63

Page 64: Arthur Gilmour - jvanderw.une.edu.au

Order of processing

Read .as file down to model

Read data file

Produce data summaries

Do Plots and tabulations

Read Variance structure lines

Fit model

Report results

Armidale Animal Breeding Summer Course AABSC 2005 – p. 64

Page 65: Arthur Gilmour - jvanderw.une.edu.au

GIGO

Check ASReml has read the data correctly1. Number of records read/retained2. Mean and range of variables3. Distribution of data

!SUM summary!X !Y plotTABULATE

Armidale Animal Breeding Summer Course AABSC 2005 – p. 65

Page 66: Arthur Gilmour - jvanderw.une.edu.au

ASReml workshop

1.5 Exercises

Arthur Gilmour

Armidale Animal Breeding Summer Course AABSC 2005 – p. 66

Page 67: Arthur Gilmour - jvanderw.une.edu.au

Zinc data

Use !SUM to explore data structure

Define Source using !I

Use !X !Y to plot SeedZn vs LeafZn

Use sqrt() to transform to Square roots

Fit Leaf ˜ mu Seed !r Source

Armidale Animal Breeding Summer Course AABSC 2005 – p. 67

Page 68: Arthur Gilmour - jvanderw.une.edu.au

Volts data

User Guide 15.3

Identify outliers - assess effect of droppingtwo.

Armidale Animal Breeding Summer Course AABSC 2005 – p. 68

Page 69: Arthur Gilmour - jvanderw.une.edu.au

Oats data

User Guide 15.1

Split Plot design: Blocks|Variety|Nitrogen

Use !CONTRAST to test for linear N trend

Armidale Animal Breeding Summer Course AABSC 2005 – p. 69

Page 70: Arthur Gilmour - jvanderw.une.edu.au

Rats data

User Guide 15.2

Armidale Animal Breeding Summer Course AABSC 2005 – p. 70

Page 71: Arthur Gilmour - jvanderw.une.edu.au

Own data

Prepare job to read and summarize the data

Armidale Animal Breeding Summer Course AABSC 2005 – p. 71