BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Joa14
Obsidian | Level 7
 

 I am struggling with getting the right code on xls. exported data to estimate the initial values of model parameters (logistic, Gompertz, Richards, and Weibull) my ymax is 61.0

I tried with these two but I get error:

Any suggestion? Thanks!

 

DATA=ALL

YMAX=61.0

LOGISTIC=LOG((YMAX/Y)-1);

GOMPERTZ=LOG(-LOG(Y/YMAX));

RICHARDS=LOG(1-(Y/YMAX));

WEIBULL=LOG((-LOG(1-(Y/YMAX));

LNX=LOG(X);

RUN;

PROC REG DATA=ALL

MODEL LOGISTIC=X;

MODEL GOMPERTZ=X;

MODEL RICHARDS=X

MODEL WEIBULL=LNX;

RUN;

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

There is no equal sign in a DATA statement. DATA statements must end with a semi-colon. Assigning values must end with a semi-colon. Variables Y and X are never assigned a value. The number of open parentheses in a statement must equal the number of close parentheses in the statement.

 

Also you can't fit a regression to this data, it has only one data point.

 

 

--
Paige Miller

View solution in original post

11 REPLIES 11
PaigeMiller
Diamond | Level 26

There is no equal sign in a DATA statement. DATA statements must end with a semi-colon. Assigning values must end with a semi-colon. Variables Y and X are never assigned a value. The number of open parentheses in a statement must equal the number of close parentheses in the statement.

 

Also you can't fit a regression to this data, it has only one data point.

 

 

--
Paige Miller
Joa14
Obsidian | Level 7
Thanks, PaigeMiller!
PGStats
Opal | Level 21

Syntax should be:

 

DATA ALL;
YMAX=61.0;
set mydata; /* dataset mydata contains X and Y variables */
LOGISTIC=LOG((YMAX/Y)-1);
GOMPERTZ=LOG(-LOG(Y/YMAX));
RICHARDS=LOG(1-(Y/YMAX));
WEIBULL=LOG(-LOG(1-(Y/YMAX)));
LNX=LOG(X);
RUN;

PROC REG DATA=ALL;
var X LNX LOGISTIC GOMPERTZ RICHARDS WEIBULL;
Logistic: MODEL LOGISTIC=X;
Gompertz: MODEL GOMPERTZ=X;
Richards: MODEL RICHARDS=X;
Weibull: MODEL WEIBULL=LNX;
RUN;

(untested)

PG
PaigeMiller
Diamond | Level 26

Still needs to have open and close parentheses match.

--
Paige Miller
PGStats
Opal | Level 21

Thanks @PaigeMiller . I edited the code.

PG
Joa14
Obsidian | Level 7
Thanks, PG. It is still not working but will keep trying.
PGStats
Opal | Level 21

We would need to see the SAS log (the part showing the code and warnings/errors) to help you further.

PG
Joa14
Obsidian | Level 7
100 PROC REG DATA=WORK.IMPORT;
101 var X LNX LOGISTIC GOMPERTZ RICHARDS WEIBULL;
102 Logistic: MODEL LOGISTIC=X;
103 Gompertz: MODEL GOMPERTZ=X;
104 Richards: MODEL RICHARDS=X;
105 Weibull: MODEL WEIBULL=LNX;
106 RUN;
 
ERROR: No valid observations are found.
ERROR: No valid observations are found.
ERROR: No valid observations are found.
ERROR: No valid observations are found.
 

 

PGStats
Opal | Level 21

This message usually signals that all observations contain missing values. Please check the contents of dataset WORK.IMPORT.

PG
Joa14
Obsidian | Level 7

It seems ok to me. The data xls. format is attached if you could check. It has DBH (X) and HT (Y).

I want to do this because my goal is to use the modified logistic functions to fit the function to the data using three iteration methods available in PROC NLIN (GAUSS, MARQUARDT, and NEWTON). Then compare the parameter estimates, asymptotic standard errors for the parameters, and asymptotic correlations among the parameters for the three methods.

 

PaigeMiller
Diamond | Level 26

When @PGStats says check the data, he specifically means (and specifically stated) check the SAS data set you are using, specifically you need to look at WORK.IMPORT and see if everything is okay in there. The XLS file is irrelevant.

--
Paige Miller

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 11 replies
  • 1356 views
  • 1 like
  • 3 in conversation