1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
55
56 /* Generated Code (IMPORT) */
57 /* Source File: QM13.xls */
58 /* Source Path: /folders/myfolders/sasuser.v94 */
59 /* Code generated on: 9/11/16, 1:18 AM */
60
61 %web_drop_table(WORK.IMPORT);
NOTE: Table WORK.IMPORT has been dropped.
NOTE: PROCEDURE SQL used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
62
63
64 FILENAME REFFILE '/folders/myfolders/sasuser.v94/QM13.xls';
65
66 PROC IMPORT DATAFILE=REFFILE
67 DBMS=XLS
68 OUT=WORK.IMPORT;
69 GETNAMES=YES;
70 RUN;
NOTE: The import data set has 2488 observations and 43 variables.
NOTE: WORK.IMPORT data set was successfully created.
NOTE: PROCEDURE IMPORT used (Total process time):
real time 0.03 seconds
cpu time 0.03 seconds
71
72 PROC CONTENTS DATA=WORK.IMPORT; RUN;
NOTE: PROCEDURE CONTENTS used (Total process time):
real time 0.24 seconds
cpu time 0.24 seconds
73
74
75 %web_open_table(WORK.IMPORT);
76
77 /*Para preparar um vector contendo os valores das variaveis dependentes*/
78 data nova_base;
79 set WORK.IMPORT;
80 array y(2) morte_materna morte_neonatal;
81 do j=1 to 2;
82 morte=y(j); *Array com os valores de Y1 e Y2;
83 if j=1 then dist='Binomial'; else dist='Binary'; *Para identificar a distribuicao de cada variavel
84 (Note que funcao de verossimilhanca de Binomial = Binary);
85 output;
86 end;
87 run;
NOTE: There were 2488 observations read from the data set WORK.IMPORT.
NOTE: The data set WORK.NOVA_BASE has 4976 observations and 46 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.02 seconds
88
89
90 /*Modelo logistico bivariado com distribuicao normal para variavel latente u=(u1 u2)*/
91 /*Modelos apenas com intercepto*/
92 proc nlmixed data=nova_base qpoints=5;
93 parms beta01=1 beta02=1 sigma1=1 sigma2=1 sigma12=1; *para definir as estimativas iniciais dos parametros do modelo
94 (pode adicionar mais estimativas se necessario);
95
96 if dist = "Binomial" then do; *Para variavel dependente morte_materna;
97 xbeta1 = beta01*(PROV_CODE=1) + beta02*(DIST_CODE=1) + beta03*(UPA) + beta04*(nome_distrito) + beta05*(nome_provincia) +
97 ! beta06*(tipo_sanitaria) + beta07*(numero_mulher) + beta08*(data_colheita_dia) + beta09*(data_colheita_mes) +
97 ! beta10*(data_colheita_anos) + beta11*(localizacao) + beta12*(tipo_organis_gerente) + beta13*(idade_mulher) +
97 ! beta14*(n_partos_mulher) + beta15*(n_abortos_mulher) + beta16*(n_nados_mortos_mulher) + beta17*(n_filhos_vivos_mulher) +
97 ! beta18*(gestacao_actual) + beta19*(partos_ant_cesariana) + beta20*(massagem_uterina) + beta21*(malfor_congen)+
97 ! beta22*(foi_reanimacao) + beta23*(ventilaca_press_posit) + beta24*(morte_materna) + beta25*(morte_neonatal) +
97 ! beta26*(total_partos) + beta27*(total_cesariana) + beta28*(mch_nurses) + beta29*(md_sav) + beta30*(mch_sav) +
97 ! beta31*(surg_sav) + beta32*(mch_mater) + beta33*(md_mater) + beta34*(surg_mater) + beta35*(kit_del) +beta36*(kit_res_1)
97 ! + beta37*(kit_res_2) + beta38*(equipmedicine) +beta39*(medicine_cat) + beta40*(taxa_cesariana) + u1; *Escrever aqui a
97 ! funcao linear para Y1 (morte_materna);
22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, (, *, **, +, -, /, <, <=, <>, =, >, ><, >=, AND, EQ, GE, GT,
LE, LT, NE, OR, ^<, ^=, ^>, |, ||, ~<, ~=, ~>.
76: LINE and COLUMN cannot be determined.
NOTE: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 76-322: Syntax error, statement will be ignored.
NOTE: Character value converted to numeric for argument 2 of '*' operation.
NOTE: Character value converted to numeric for argument 2 of '*' operation.
98 p1 = exp(morte_materna)/(1+exp(morte_materna));
99 ll = morte*log(p1) + (1-morte)*log(1-p1);
100 end;
101 if dist = "Binary" then do; *Para variavel dependente morte_neonatal;
102 xbeta2 = beta41*(PROV_CODE=1) + beta42*(DIST_CODE=1) + beta43*(UPA) + beta44*(nome_distrito) + beta45*(nome_provincia) +
102 ! beta46*(tipo_sanitaria) + beta47*(numero_mulher) + beta48*(data_colheita_dia) + beta49*(data_colheita_mes) +
102 ! beta50*(data_colheita_anos) + beta51*(localizacao) + beta52*(tipo_organis_gerente) + beta53*(idade_mulher) +
102 ! beta54*(n_partos_mulher) + beta55*(n_abortos_mulher) + beta56*(n_nados_mortos_mulher) + beta57*(n_filhos_vivos_mulher)+
102 ! beta58*(gestacao_actual) + beta59*(partos_ant_cesariana) + beta60*(massagem_uterina) + beta61*(malfor_congen)+
102 ! beta62*(foi_reanimacao)+ beta63*(ventilaca_press_posit) + beta64*(morte_materna) + beta65*(morte_neonatal) +
102 ! beta66*(total_partos)+ beta67*(total_cesariana) + beta68*(mch_nurses) + beta69*(md_sav) + beta70*(mch_sav) +
102 ! beta71*(surg_sav) + beta72*(mch_mater)+ beta73*(md_mater) + beta74*(surg_mater) + beta75*(kit_del) + beta76*(kit_res_1)
102 ! + beta77*(kit_res_2) + beta78*(equipmedicine)+ beta79*(medicine_cat)+ beta80*(taxa_cesariana) + u2; *Escrever aqui a
102 ! funcao linear para Y2 (morte_neonatal);
22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, (, *, **, +, -, /, <, <=, <>, =, >, ><, >=, AND, EQ, GE, GT,
LE, LT, NE, OR, ^<, ^=, ^>, |, ||, ~<, ~=, ~>.
76: LINE and COLUMN cannot be determined.
NOTE: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 76-322: Syntax error, statement will be ignored.
103 p2 = exp(morte_neonatal)/(1+exp(morte_neonatal));
104 ll = morte*log(p2) + (1-morte)*log(1-p2);
105 end;
106 model morte ~ general(ll);
107 random u1 u2 ~normal([0,0],[sigma1**2,sigma12,sigma2**2]) subject=casoID; *Para definir a distribuicao da variavel
107 ! latente (casoID= variavel que identifica cada caso na base de dados);
108 estimate 'corr' sigma12/(sigma1*sigma2);
109 run;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE NLMIXED used (Total process time):
real time 0.05 seconds
cpu time 0.07 seconds
110
111 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
123
Pay attention to the next notes in your log:
22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
Add OPTIONS SPOOL; before the failed step and rerun.
You might find better error reference to repair.
I will do that before i telling u how much or fix solution done... thanks
Did you really type that line with 40+ terms on one line of code?
It will probably help if you split it into mulitple lines. Then perhaps you will notice the typo or the strange character that has been inserted that is causing the error.
If you generated it via macro code then perhaps there is macro quoting that is confusing SAS. Try adding %UNQUOTE() function to remove the macro quoting.
if dist = "Binomial" then do;
*Para variavel dependente morte_materna;
xbeta1
= beta01*(PROV_CODE=1)
+ beta02*(DIST_CODE=1)
+ beta03*(UPA)
+ beta04*(nome_distrito)
+ beta05*(nome_provincia)
+ beta06*(tipo_sanitaria)
+ beta07*(numero_mulher)
+ beta08*(data_colheita_dia)
+ beta09*(data_colheita_mes)
+ beta10*(data_colheita_anos)
+ beta11*(localizacao)
+ beta12*(tipo_organis_gerente)
+ beta13*(idade_mulher)
+ beta14*(n_partos_mulher)
+ beta15*(n_abortos_mulher)
+ beta16*(n_nados_mortos_mulher)
+ beta17*(n_filhos_vivos_mulher)
+ beta18*(gestacao_actual)
+ beta19*(partos_ant_cesariana)
+ beta20*(massagem_uterina)
+ beta21*(malfor_congen)
+ beta22*(foi_reanimacao)
+ beta23*(ventilaca_press_posit)
+ beta24*(morte_materna)
+ beta25*(morte_neonatal)
+ beta26*(total_partos)
+ beta27*(total_cesariana)
+ beta28*(mch_nurses)
+ beta29*(md_sav)
+ beta30*(mch_sav)
+ beta31*(surg_sav)
+ beta32*(mch_mater)
+ beta33*(md_mater)
+ beta34*(surg_mater)
+ beta35*(kit_del)
+ beta36*(kit_res_1)
+ beta37*(kit_res_2)
+ beta38*(equipmedicine)
+ beta39*(medicine_cat)
+ beta40*(taxa_cesariana)
+ u1
;
*Escrever aqui a funcao linear para Y1 (morte_materna);
i will work on that.... thanks
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.