version 1.121, 2006/03/16 17:45:01
|
version 1.122, 2006/03/20 09:45:41
|
Line 1
|
Line 1
|
/* $Id$ |
/* $Id$ |
$State$ |
$State$ |
$Log$ |
$Log$ |
|
Revision 1.122 2006/03/20 09:45:41 brouard |
|
(Module): Weights can have a decimal point as for |
|
English (a comma might work with a correct LC_NUMERIC environment, |
|
otherwise the weight is truncated). |
|
Modification of warning when the covariates values are not 0 or |
|
1. |
|
Version 0.98g |
|
|
Revision 1.121 2006/03/16 17:45:01 lievre |
Revision 1.121 2006/03/16 17:45:01 lievre |
* imach.c (Module): Comments concerning covariates added |
* imach.c (Module): Comments concerning covariates added |
|
|
Line 341 extern int errno;
|
Line 349 extern int errno;
|
/* $Id$ */ |
/* $Id$ */ |
/* $State$ */ |
/* $State$ */ |
|
|
char version[]="Imach version 0.98f, March 2006, INED-EUROREVES-Institut de longevite "; |
char version[]="Imach version 0.98g, March 2006, INED-EUROREVES-Institut de longevite "; |
char fullversion[]="$Revision$ $Date$"; |
char fullversion[]="$Revision$ $Date$"; |
char strstart[80]; |
char strstart[80]; |
char optionfilext[10], optionfilefiname[FILENAMELENGTH]; |
char optionfilext[10], optionfilefiname[FILENAMELENGTH]; |
Line 416 char strcurr[80], strfor[80];
|
Line 424 char strcurr[80], strfor[80];
|
|
|
char *endptr; |
char *endptr; |
long lval; |
long lval; |
|
double dval; |
|
|
#define NR_END 1 |
#define NR_END 1 |
#define FREE_ARG char* |
#define FREE_ARG char* |
Line 4813 int main(int argc, char *argv[])
|
Line 4822 int main(int argc, char *argv[])
|
|
|
cutv(stra, strb,line,' '); |
cutv(stra, strb,line,' '); |
errno=0; |
errno=0; |
lval=strtol(strb,&endptr,10); |
dval=strtod(strb,&endptr); |
if( strb[0]=='\0' || (*endptr != '\0')){ |
if( strb[0]=='\0' || (*endptr != '\0')){ |
printf("Error reading data around '%d' at line number %ld %s for individual %d\nShould be a weight. Exiting.\n",lval, i,line,linei); |
printf("Error reading data around '%f' at line number %ld, \"%s\" for individual %d\nShould be a weight. Exiting.\n",dval, i,line,linei); |
exit(1); |
exit(1); |
} |
} |
weight[i]=(double)(lval); |
weight[i]=dval; |
strcpy(line,stra); |
strcpy(line,stra); |
|
|
for (j=ncovcol;j>=1;j--){ |
for (j=ncovcol;j>=1;j--){ |
Line 4830 int main(int argc, char *argv[])
|
Line 4839 int main(int argc, char *argv[])
|
exit(1); |
exit(1); |
} |
} |
if(lval <-1 || lval >1){ |
if(lval <-1 || lval >1){ |
printf("Error reading data around '%d' at line number %ld %s for individual %d, '%s'\nShould be a value of the %d covar (meaning 0 for the reference or 1. IMaCh does not build design variables, do it your self). Exiting.\n",lval,linei, i,line,j); |
printf("Error reading data around '%d' at line number %ld for individual %d, '%s'\n \ |
|
Should be a value of %d(nth) covariate (0 should be the value for the reference and 1\n \ |
|
for the alternative. IMaCh does not build design variables automatically, do it yourself.\n \ |
|
For example, for multinomial values like 1, 2 and 3,\n \ |
|
build V1=0 V2=0 for the reference value (1),\n \ |
|
V1=1 V2=0 for (2) \n \ |
|
and V1=0 V2=1 for (3). V1=1 V2=1 should not exist and the corresponding\n \ |
|
output of IMaCh is often meaningless.\n \ |
|
Exiting.\n",lval,linei, i,line,j); |
exit(1); |
exit(1); |
} |
} |
covar[j][i]=(double)(lval); |
covar[j][i]=(double)(lval); |