Programming the statistical procedures from SAS

PROC NLIN - GRAPHICS HELP!!

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 103
Accepted Solution

PROC NLIN - GRAPHICS HELP!!

Hi there my SAS friends:

I need some Help to make graphics for this routine.

I call "plots=all" but i need the graphic of those 3 Tratamientos into 1.

Where x=Semana and y=gramos

Im sorry, those variables are in spanish

Tratamiento=Trait

Semana=week

gramos=grams

Here an example as JPG: http://www.scielo.br/img/revistas/abmvz/v65n5/a33fig02.jpg

Data cuyes;

input Tratamiento Animal Semana Gramos;

cards;

1 1 0 268

1 1 1 304

1 1 2 340

1 1 3 387

1 1 4 436

1 1 5 505

1 1 6 568

1 1 7 620

1 1 8 692

1 1 9 748

1 1 10 787

1 2 0 240

1 2 1 285

1 2 2 349

1 2 3 404

1 2 4 469

1 2 5 536

1 2 6 588

1 2 7 639

1 2 8 686

1 2 9 728

1 2 10 777

1 3 0 276

1 3 1 334

1 3 2 394

1 3 3 450

1 3 4 518

1 3 5 583

1 3 6 643

1 3 7 708

1 3 8 763

1 3 9 813

1 3 10 873

1 4 0 292

1 4 1 336

1 4 2 380

1 4 3 456

1 4 4 498

1 4 5 534

1 4 6 558

1 4 7 600

1 4 8 656

1 4 9 708

1 4 10 747

1 5 0 354

1 5 1 389

1 5 2 427

1 5 3 472

1 5 4 515

1 5 5 560

1 5 6 608

1 5 7 658

1 5 8 708

1 5 9 758

1 5 10 809

1 6 0 298

1 6 1 338

1 6 2 389

1 6 3 432

1 6 4 501

1 6 5 566

1 6 6 623

1 6 7 687

1 6 8 733

1 6 9 787

1 6 10 847

1 7 0 310

1 7 1 360

1 7 2 402

1 7 3 459

1 7 4 508

1 7 5 578

1 7 6 643

1 7 7 703

1 7 8 769

1 7 9 834

1 7 10 894

1 8 0 296

1 8 1 324

1 8 2 350

1 8 3 386

1 8 4 431

1 8 5 479

1 8 6 524

1 8 7 574

1 8 8 626

1 8 9 678

1 8 10 722

1 9 0 338

1 9 1 370

1 9 2 420

1 9 3 461

1 9 4 510

1 9 5 557

1 9 6 609

1 9 7 656

1 9 8 708

1 9 9 764

1 9 10 811

1 10 0 288

1 10 1 344

1 10 2 396

1 10 3 448

1 10 4 504

1 10 5 552

1 10 6 607

1 10 7 666

1 10 8 724

1 10 9 785

1 10 10 833

1 11 0 348

1 11 1 395

1 11 2 380

1 11 3 420

1 11 4 487

1 11 5 570

1 11 6 622

1 11 7 690

1 11 8 749

1 11 9 800

1 11 10 850

1 12 0 356

1 12 1 392

1 12 2 426

1 12 3 462

1 12 4 502

1 12 5 548

1 12 6 597

1 12 7 630

1 12 8 678

1 12 9 723

1 12 10 858

1 13 0 320

1 13 1 372

1 13 2 448

1 13 3 504

1 13 4 592

1 13 5 632

1 13 6 706

1 13 7 769

1 13 8 815

1 13 9 862

1 13 10 908

1 14 0 308

1 14 1 354

1 14 2 402

1 14 3 440

1 14 4 487

1 14 5 542

1 14 6 602

1 14 7 649

1 14 8 688

1 14 9 728

1 14 10 769

1 15 0 300

1 15 1 354

1 15 2 406

1 15 3 466

1 15 4 516

1 15 5 561

1 15 6 626

1 15 7 684

1 15 8 750

1 15 9 802

1 15 10 849

1 16 0 294

1 16 1 344

1 16 2 400

1 16 3 456

1 16 4 520

1 16 5 578

1 16 6 640

1 16 7 704

1 16 8 756

1 16 9 805

1 16 10 866

1 49 0 256

1 49 1 300

1 49 2 348

1 49 3 392

1 49 4 446

1 49 5 500

1 49 6 548

1 49 7 602

1 49 8 652

1 49 9 718

1 49 10 767

1 50 0 330

1 50 1 385

1 50 2 439

1 50 3 494

1 50 4 559

1 50 5 606

1 50 6 668

1 50 7 719

1 50 8 766

1 50 9 828

1 50 10 891

1 51 0 275

1 51 1 320

1 51 2 370

1 51 3 410

1 51 4 460

1 51 5 515

1 51 6 572

1 51 7 635

1 51 8 685

1 51 9 765

1 51 10 815

1 52 0 328

1 52 1 376

1 52 2 420

1 52 3 486

1 52 4 528

1 52 5 584

1 52 6 629

1 52 7 690

1 52 8 756

1 52 9 808

1 52 10 871

1 53 0 340

1 53 1 398

1 53 2 435

1 53 3 483

1 53 4 536

1 53 5 600

1 53 6 656

1 53 7 702

1 53 8 758

1 53 9 809

1 53 10 869

1 54 0 290

1 54 1 345

1 54 2 399

1 54 3 442

1 54 4 497

1 54 5 560

1 54 6 613

1 54 7 677

1 54 8 723

1 54 9 780

1 54 10 827

1 55 0 315

1 55 1 371

1 55 2 432

1 55 3 489

1 55 4 548

1 55 5 602

1 55 6 663

1 55 7 719

1 55 8 779

1 55 9 837

1 55 10 902

1 56 0 285

1 56 1 330

1 56 2 382

1 56 3 426

1 56 4 473

1 56 5 529

1 56 6 564

1 56 7 614

1 56 8 666

1 56 9 718

1 56 10 782

1 57 0 260

1 57 1 310

1 57 2 420

1 57 3 461

1 57 4 510

1 57 5 557

1 57 6 609

1 57 7 656

1 57 8 708

1 57 9 764

1 57 10 811

1 58 0 350

1 58 1 394

1 58 2 446

1 58 3 498

1 58 4 564

1 58 5 612

1 58 6 677

1 58 7 736

1 58 8 784

1 58 9 825

1 58 10 883

1 59 0 270

1 59 1 324

1 59 2 374

1 59 3 420

1 59 4 478

1 59 5 533

1 59 6 700

1 59 7 768

1 59 8 823

1 59 9 876

1 59 10 923

1 60 0 305

1 60 1 352

1 60 2 406

1 60 3 458

1 60 4 504

1 60 5 568

1 60 6 607

1 60 7 660

1 60 8 728

1 60 9 783

1 60 10 828

1 61 0 322

1 61 1 361

1 61 2 408

1 61 3 449

1 61 4 502

1 61 5 562

1 61 6 716

1 61 7 769

1 61 8 825

1 61 9 874

1 61 10 929

1 62 0 289

1 62 1 344

1 62 2 387

1 62 3 430

1 62 4 482

1 62 5 528

1 62 6 588

1 62 7 629

1 62 8 688

1 62 9 748

1 62 10 802

1 63 0 266

1 63 1 307

1 63 2 366

1 63 3 516

1 63 4 578

1 63 5 641

1 63 6 696

1 63 7 743

1 63 8 800

1 63 9 852

1 63 10 903

1 64 0 332

1 64 1 374

1 64 2 420

1 64 3 476

1 64 4 520

1 64 5 580

1 64 6 643

1 64 7 701

1 64 8 752

1 64 9 809

1 64 10 866

2 17 0 324

2 17 1 400

2 17 2 486

2 17 3 584

2 17 4 674

2 17 5 760

2 17 6 867

2 17 7 902

2 17 8 1118

2 17 9 1220

2 17 10 1327

2 18 0 342

2 18 1 426

2 18 2 516

2 18 3 618

2 18 4 708

2 18 5 803

2 18 6 909

2 18 7 1008

2 18 8 1080

2 18 9 1195

2 18 10 1274

2 19 0 292

2 19 1 377

2 19 2 467

2 19 3 572

2 19 4 662

2 19 5 760

2 19 6 872

2 19 7 948

2 19 8 1024

2 19 9 1118

2 19 10 1208

2 20 0 300

2 20 1 364

2 20 2 430

2 20 3 500

2 20 4 578

2 20 5 656

2 20 6 740

2 20 7 826

2 20 8 910

2 20 9 1009

2 20 10 1098

2 21 0 289

2 21 1 354

2 21 2 424

2 21 3 491

2 21 4 561

2 21 5 632

2 21 6 700

2 21 7 802

2 21 8 893

2 21 9 984

2 21 10 1072

2 22 0 356

2 22 1 390

2 22 2 430

2 22 3 488

2 22 4 548

2 22 5 597

2 22 6 650

2 22 7 708

2 22 8 763

2 22 9 833

2 22 10 997

2 23 0 358

2 23 1 422

2 23 2 568

2 23 3 644

2 23 4 716

2 23 5 788

2 23 6 849

2 23 7 932

2 23 8 1008

2 23 9 1090

2 23 10 1183

2 24 0 298

2 24 1 348

2 24 2 420

2 24 3 498

2 24 4 576

2 24 5 654

2 24 6 728

2 24 7 802

2 24 8 878

2 24 9 962

2 24 10 1055

2 25 0 318

2 25 1 416

2 25 2 501

2 25 3 596

2 25 4 672

2 25 5 748

2 25 6 828

2 25 7 898

2 25 8 978

2 25 9 1072

2 25 10 1169

2 26 0 294

2 26 1 376

2 26 2 448

2 26 3 528

2 26 4 603

2 26 5 675

2 26 6 753

2 26 7 833

2 26 8 997

2 26 9 1077

2 26 10 1156

2 27 0 274

2 27 1 342

2 27 2 406

2 27 3 518

2 27 4 608

2 27 5 692

2 27 6 770

2 27 7 854

2 27 8 934

2 27 9 1005

2 27 10 1100

2 28 0 326

2 28 1 380

2 28 2 442

2 28 3 507

2 28 4 577

2 28 5 648

2 28 6 714

2 28 7 786

2 28 8 852

2 28 9 919

2 28 10 1068

2 29 0 294

2 29 1 356

2 29 2 436

2 29 3 558

2 29 4 650

2 29 5 752

2 29 6 890

2 29 7 982

2 29 8 1073

2 29 9 1189

2 29 10 1265

2 30 0 360

2 30 1 432

2 30 2 517

2 30 3 595

2 30 4 666

2 30 5 734

2 30 6 816

2 30 7 892

2 30 8 960

2 30 9 1022

2 30 10 1114

2 31 0 366

2 31 1 464

2 31 2 582

2 31 3 698

2 31 4 794

2 31 5 904

2 31 6 1012

2 31 7 1114

2 31 8 1196

2 31 9 1248

2 31 10 1320

2 32 0 352

2 32 1 428

2 32 2 500

2 32 3 578

2 32 4 653

2 32 5 735

2 32 6 800

2 32 7 872

2 32 8 943

2 32 9 1016

2 32 10 1108

2 65 0 312

2 65 1 398

2 65 2 476

2 65 3 564

2 65 4 662

2 65 5 755

2 65 6 860

2 65 7 942

2 65 8 1028

2 65 9 1100

2 65 10 1192

2 66 0 323

2 66 1 406

2 66 2 509

2 66 3 600

2 66 4 688

2 66 5 783

2 66 6 979

2 66 7 1088

2 66 8 1170

2 66 9 1265

2 66 10 1343

2 67 0 295

2 67 1 353

2 67 2 467

2 67 3 562

2 67 4 642

2 67 5 753

2 67 6 862

2 67 7 958

2 67 8 1057

2 67 9 1150

2 67 10 1258

2 68 0 348

2 68 1 394

2 68 2 440

2 68 3 520

2 68 4 598

2 68 5 676

2 68 6 780

2 68 7 879

2 68 8 960

2 68 9 1069

2 68 10 1188

2 69 0 288

2 69 1 374

2 69 2 464

2 69 3 559

2 69 4 641

2 69 5 732

2 69 6 819

2 69 7 902

2 69 8 993

2 69 9 1084

2 69 10 1172

2 70 0 346

2 70 1 400

2 70 2 467

2 70 3 548

2 70 4 652

2 70 5 557

2 70 6 650

2 70 7 738

2 70 8 823

2 70 9 940

2 70 10 1023

2 71 0 278

2 71 1 362

2 71 2 468

2 71 3 554

2 71 4 746

2 71 5 858

2 71 6 949

2 71 7 1012

2 71 8 1098

2 71 9 1180

2 71 10 1273

2 72 0 293

2 72 1 388

2 72 2 477

2 72 3 598

2 72 4 686

2 72 5 784

2 72 6 880

2 72 7 992

2 72 8 1088

2 72 9 1162

2 72 10 1255

2 73 0 298

2 73 1 346

2 73 2 531

2 73 3 628

2 73 4 702

2 73 5 818

2 73 6 928

2 73 7 1012

2 73 8 1105

2 73 9 1192

2 73 10 1289

2 74 0 322

2 74 1 380

2 74 2 470

2 74 3 562

2 74 4 654

2 74 5 755

2 74 6 859

2 74 7 943

2 74 8 1057

2 74 9 1161

2 74 10 1256

2 75 0 307

2 75 1 356

2 75 2 412

2 75 3 513

2 75 4 611

2 75 5 722

2 75 6 830

2 75 7 929

2 75 8 1034

2 75 9 1119

2 75 10 1200

2 76 0 336

2 76 1 400

2 76 2 482

2 76 3 577

2 76 4 680

2 76 5 781

2 76 6 892

2 76 7 986

2 76 8 1082

2 76 9 1190

2 76 10 1275

2 77 0 272

2 77 1 326

2 77 2 439

2 77 3 538

2 77 4 640

2 77 5 732

2 77 6 833

2 77 7 927

2 77 8 1023

2 77 9 1129

2 77 10 1204

2 78 0 318

2 78 1 402

2 78 2 497

2 78 3 575

2 78 4 669

2 78 5 764

2 78 6 866

2 78 7 972

2 78 8 1060

2 78 9 1152

2 78 10 1264

2 79 0 302

2 79 1 374

2 79 2 465

2 79 3 558

2 79 4 664

2 79 5 754

2 79 6 862

2 79 7 974

2 79 8 1086

2 79 9 1178

2 79 10 1280

2 80 0 280

2 80 1 348

2 80 2 423

2 80 3 538

2 80 4 643

2 80 5 739

2 80 6 820

2 80 7 908

2 80 8 996

2 80 9 1086

2 80 10 1178

3 33 0 320

3 33 1 360

3 33 2 402

3 33 3 448

3 33 4 500

3 33 5 552

3 33 6 602

3 33 7 657

3 33 8 713

3 33 9 768

3 33 10 822

3 34 0 258

3 34 1 299

3 34 2 342

3 34 3 388

3 34 4 442

3 34 5 496

3 34 6 551

3 34 7 611

3 34 8 667

3 34 9 727

3 34 10 865

3 35 0 280

3 35 1 314

3 35 2 372

3 35 3 444

3 35 4 522

3 35 5 606

3 35 6 670

3 35 7 740

3 35 8 817

3 35 9 989

3 35 10 1078

3 36 0 368

3 36 1 426

3 36 2 506

3 36 3 584

3 36 4 659

3 36 5 741

3 36 6 821

3 36 7 904

3 36 8 985

3 36 9 1064

3 36 10 1149

3 37 0 342

3 37 1 412

3 37 2 498

3 37 3 580

3 37 4 660

3 37 5 736

3 37 6 808

3 37 7 880

3 37 8 960

3 37 9 1040

3 37 10 1028

3 38 0 286

3 38 1 363

3 38 2 413

3 38 3 469

3 38 4 529

3 38 5 598

3 38 6 667

3 38 7 737

3 38 8 809

3 38 9 884

3 38 10 981

3 39 0 362

3 39 1 412

3 39 2 498

3 39 3 574

3 39 4 668

3 39 5 760

3 39 6 838

3 39 7 924

3 39 8 1005

3 39 9 1084

3 39 10 1167

3 40 0 272

3 40 1 356

3 40 2 418

3 40 3 490

3 40 4 576

3 40 5 650

3 40 6 724

3 40 7 795

3 40 8 865

3 40 9 939

3 40 10 1008

3 41 0 300

3 41 1 340

3 41 2 400

3 41 3 462

3 41 4 540

3 41 5 618

3 41 6 704

3 41 7 788

3 41 8 859

3 41 9 939

3 41 10 1017

3 42 0 302

3 42 1 354

3 42 2 419

3 42 3 474

3 42 4 529

3 42 5 602

3 42 6 672

3 42 7 768

3 42 8 830

3 42 9 909

3 42 10 989

3 43 0 352

3 43 1 338

3 43 2 396

3 43 3 455

3 43 4 517

3 43 5 593

3 43 6 661

3 43 7 744

3 43 8 824

3 43 9 916

3 43 10 1008

3 44 0 262

3 44 1 250

3 44 2 324

3 44 3 406

3 44 4 504

3 44 5 596

3 44 6 683

3 44 7 763

3 44 8 843

3 44 9 925

3 44 10 1018

3 45 0 328

3 45 1 394

3 45 2 459

3 45 3 529

3 45 4 599

3 45 5 675

3 45 6 755

3 45 7 833

3 45 8 911

3 45 9 991

3 45 10 1067

3 46 0 348

3 46 1 398

3 46 2 460

3 46 3 528

3 46 4 598

3 46 5 670

3 46 6 745

3 46 7 820

3 46 8 898

3 46 9 973

3 46 10 1056

3 47 0 352

3 47 1 400

3 47 2 445

3 47 3 486

3 47 4 556

3 47 5 626

3 47 6 700

3 47 7 772

3 47 8 830

3 47 9 889

3 47 10 950

3 48 0 344

3 48 1 404

3 48 2 468

3 48 3 534

3 48 4 599

3 48 5 669

3 48 6 737

3 48 7 803

3 48 8 868

3 48 9 934

3 48 10 992

3 81 0 268

3 81 1 319

3 81 2 405

3 81 3 468

3 81 4 570

3 81 5 658

3 81 6 750

3 81 7 847

3 81 8 933

3 81 9 1020

3 81 10 1192

3 82 0 355

3 82 1 413

3 82 2 487

3 82 3 358

3 82 4 422

3 82 5 490

3 82 6 561

3 82 7 623

3 82 8 697

3 82 9 757

3 82 10 845

3 83 0 279

3 83 1 366

3 83 2 452

3 83 3 534

3 83 4 607

3 83 5 676

3 83 6 750

3 83 7 820

3 83 8 897

3 83 9 962

3 83 10 1038

3 84 0 312

3 84 1 396

3 84 2 466

3 84 3 544

3 84 4 629

3 84 5 701

3 84 6 789

3 84 7 904

3 84 8 968

3 84 9 1044

3 84 10 1119

3 85 0 335

3 85 1 382

3 85 2 468

3 85 3 540

3 85 4 621

3 85 5 726

3 85 6 800

3 85 7 877

3 85 8 940

3 85 9 1010

3 85 10 1082

3 86 0 278

3 86 1 341

3 86 2 410

3 86 3 479

3 86 4 559

3 86 5 618

3 86 6 700

3 86 7 781

3 86 8 879

3 86 9 966

3 86 10 1044

3 87 0 298

3 87 1 352

3 87 2 418

3 87 3 501

3 87 4 573

3 87 5 660

3 87 6 742

3 87 7 824

3 87 8 902

3 87 9 988

3 87 10 1061

3 88 0 345

3 88 1 406

3 88 2 472

3 88 3 517

3 88 4 596

3 88 5 670

3 88 6 754

3 88 7 835

3 88 8 901

3 88 9 979

3 88 10 1058

3 89 0 299

3 89 1 355

3 89 2 429

3 89 3 508

3 89 4 580

3 89 5 639

3 89 6 711

3 89 7 793

3 89 8 869

3 89 9 931

3 89 10 1010

3 90 0 303

3 90 1 367

3 90 2 442

3 90 3 504

3 90 4 589

3 90 5 672

3 90 6 756

3 90 7 822

3 90 8 899

3 90 9 967

3 90 10 1033

3 91 0 254

3 91 1 320

3 91 2 389

3 91 3 465

3 91 4 527

3 91 5 603

3 91 6 681

3 91 7 769

3 91 8 844

3 91 9 909

3 91 10 981

3 92 0 300

3 92 1 253

3 92 2 318

3 92 3 399

3 92 4 474

3 92 5 566

3 92 6 653

3 92 7 733

3 92 8 817

3 92 9 896

3 92 10 979

3 93 0 347

3 93 1 404

3 93 2 489

3 93 3 569

3 93 4 625

3 93 5 700

3 93 6 785

3 93 7 863

3 93 8 950

3 93 9 1032

3 93 10 1107

3 94 0 276

3 94 1 340

3 94 2 410

3 94 3 488

3 94 4 566

3 94 5 642

3 94 6 725

3 94 7 809

3 94 8 878

3 94 9 963

3 94 10 1036

3 95 0 290

3 95 1 356

3 95 2 426

3 95 3 506

3 95 4 597

3 95 5 667

3 95 6 745

3 95 7 830

3 95 8 922

3 95 9 1001

3 95 10 1085

3 96 0 312

3 96 1 374

3 96 2 458

3 96 3 534

3 96 4 607

3 96 5 678

3 96 6 749

3 96 7 829

3 96 8 912

3 96 9 990

3 96 10 1050

;

proc nlin data=cuyes plots=all method=marquardt;

by Tratamiento;

parms a0=309.2395833 b0=-1.993118919 b1=-0.1993118919;

model Gramos=a0*exp(exp(b0)*(exp(b1*semana)-1)/b1);

id Animal;

output out=est_ind p=yhat r=resid parms=a0 b0 b1;

run;


Accepted Solutions
Solution
‎03-24-2015 09:29 AM
Valued Guide
Valued Guide
Posts: 679

Re: PROC NLIN - GRAPHICS HELP!!

I am guessing you want three graph panels, with observed and predicted for each treatment. Use the SGPANEL procedure.

proc sort data=est_ind out=est_inds2;

by Tratamiento semana;

run;

proc sgpanel data=est_inds2;

panelby  Tratamiento / columns=3;

scatter y=Gramos x=semana;

series y=yhat x=semana;

run;

Or, you could get everything on one graph, as done here with SGPLOT. You would have to read more about the SG procedures to control the various (many) options.

proc sgplot data=est_inds2;

scatter y=Gramos x=semana / group=Tratamiento;

series y=yhat x=semana / group=Tratamiento;

run;

View solution in original post


All Replies
Solution
‎03-24-2015 09:29 AM
Valued Guide
Valued Guide
Posts: 679

Re: PROC NLIN - GRAPHICS HELP!!

I am guessing you want three graph panels, with observed and predicted for each treatment. Use the SGPANEL procedure.

proc sort data=est_ind out=est_inds2;

by Tratamiento semana;

run;

proc sgpanel data=est_inds2;

panelby  Tratamiento / columns=3;

scatter y=Gramos x=semana;

series y=yhat x=semana;

run;

Or, you could get everything on one graph, as done here with SGPLOT. You would have to read more about the SG procedures to control the various (many) options.

proc sgplot data=est_inds2;

scatter y=Gramos x=semana / group=Tratamiento;

series y=yhat x=semana / group=Tratamiento;

run;

Frequent Contributor
Posts: 103

Re: PROC NLIN - GRAPHICS HELP!!

Awesome, it works perfect!!

i'll try to change the line patern and erase the little balloons there, if you could herlp me with this.

Thank you so much my friend

Valued Guide
Valued Guide
Posts: 679

Re: PROC NLIN - GRAPHICS HELP!!

I am not an expert on the SG graphics, but SAS has many resources on these procedures, including a Blog

http://blogs.sas.com/content/graphicallyspeaking/

One easy way to get different line patterns is to use a different html style (preceding the code for the graph).

I like to use:

ods html style=statistical;

or

ods html style=journal; /* black and white */

You can also add options to override the defaults within the procedure.

I don't know what you mean by "the little balloons". I don't see any balloons when I run this.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 252 views
  • 0 likes
  • 2 in conversation