<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>como vc tem um modelo do tipo <br>
    </p>
    <p>            y=lambda W y + X beta + u   <br>
                  u=rho W u + e <br>
    </p>
    <p>automaticamente ja tem X lagged porque E(Y) = Xbeta. Por isso nao
      precisa criar XW.<br>
    </p>
    <p>Elias<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 21/11/2017 11:12, Edimeire Alexandra
      Pinto wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:1550618455.301078.1511269944667@mail.yahoo.com">
      <div style="color:#000; background-color:#fff;
        font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande,
        sans-serif;font-size:13px">
        <div id="yui_3_16_0_ym19_1_1511268305376_9111"><span>Olá
            pessoal.</span></div>
        <div id="yui_3_16_0_ym19_1_1511268305376_9110"><span><br>
          </span></div>
        <div id="yui_3_16_0_ym19_1_1511268305376_9109"><span>OI Elias.</span></div>
        <div id="yui_3_16_0_ym19_1_1511268305376_9112"><span><br>
          </span></div>
        <div id="yui_3_16_0_ym19_1_1511268305376_9108" dir="ltr">Recentemente
          estou estudando a função spreg para tentar resolver o problema
          de singularidade que dá. Ocorre apenas quando coloco modelos
          do tipo: Y=beta1X1+beta2WX1+beta3X2+ erro onde erro pode
          seguir o modelo SEM. Também ocorre em modelos Sarar.</div>
        <div id="yui_3_16_0_ym19_1_1511268305376_9108" dir="ltr"><br>
        </div>
        <div id="yui_3_16_0_ym19_1_1511268305376_9108" dir="ltr">O
          importante é entender que o erro ocorre sempre que ponho na
          equação X1 e WX1 em conjunto, pois se não coloco os dois ao
          mesmo tempo não dá erro. </div>
        <div id="yui_3_16_0_ym19_1_1511268305376_9108" dir="ltr"><br>
        </div>
        <div id="yui_3_16_0_ym19_1_1511268305376_9108" dir="ltr">O erro
          que ocorre em minha base de dados é similar a esse do exemplo
          abaixo, pois a mensagem de erro é sempre a mesma, estranho que
          no outro programa do Stata roda. No R, em meus dados, dá
          sempre: <b id="yui_3_16_0_ym19_1_1511268305376_19547">system
            is exactly singular</b></div>
        <div id="yui_3_16_0_ym19_1_1511268305376_9108" dir="ltr"><br>
        </div>
        <div id="yui_3_16_0_ym19_1_1511268305376_9108" dir="ltr">Pode
          ser que tenho começar a "abrir" a função no R para entendê-la
          melhor....</div>
        <div id="yui_3_16_0_ym19_1_1511268305376_9108" dir="ltr"><br>
        </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1511268305376_9481">library(spdep)</div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1511268305376_9482">require(sphet)</div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1511268305376_9483">data(columbus)</div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1511268305376_9484">listw<-nb2listw(col.gal.nb)</div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1511268305376_9485">head(columbus)</div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1511268305376_9486">WINC<-lag.listw(listw,columbus$INC,NAOK=TRUE,zero.policy
          = TRUE)</div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1511268305376_9486">columbus$WINC<-WINC<br>
        </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1511268305376_9487">res<-
          spreg(CRIME~HOVAL + INC+WINC+PLUMB, data=columbus , listw=
          listw,   het = TRUE,</div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1511268305376_9488">       
              verbose = FALSE,model = "sarar")</div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1511268305376_9489"><br
            id="yui_3_16_0_ym19_1_1511268305376_9490">
        </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1511268305376_9491">Error
          in solve.default(HH, Hye) : </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1511268305376_9492"> 
          Lapack routine dgesv: system is exactly singular: U[7,7] = 0</div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1511268305376_9492"><br>
        </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1511268305376_9492"><br>
        </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1511268305376_9492"><br>
        </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1511268305376_9492"><br>
        </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1511268305376_9492"><br>
        </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1511268305376_9492">Bem,
          faço vários tipos de modelos, SAR, SEM, DURBIN, etc etc, mas
          necessito de modelo que use tenha a variável X1 e WX1
          conjuntamente. </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1511268305376_9492"><br>
        </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1511268305376_9492"><br>
        </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1511268305376_9492">Obrigada
          pessoal , obrigada GRANDE Elias.</div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1511268305376_9492"><br>
        </div>
        <div class="qtdSeparateBR"><br>
          <br>
        </div>
        <div class="yahoo_quoted" style="display: block;">
          <div style="font-family: Helvetica Neue, Helvetica, Arial,
            Lucida Grande, sans-serif; font-size: 13px;">
            <div style="font-family: HelveticaNeue, Helvetica Neue,
              Helvetica, Arial, Lucida Grande, sans-serif; font-size:
              16px;">
              <div dir="ltr"><font size="2" face="Arial"> Em
                  Terça-feira, 21 de Novembro de 2017 9:11, Elias T.
                  Krainski via R-br <a class="moz-txt-link-rfc2396E" href="mailto:r-br@listas.c3sl.ufpr.br"><r-br@listas.c3sl.ufpr.br></a>
                  escreveu:<br>
                </font></div>
              <br>
              <br>
              <div class="y_msg_container">
                <div id="yiv7115735874">
                  <div>
                    <div>Oi Edimeire, <br clear="none">
                    </div>
                    Acho que a implementação no 'spdep' não é muito
                    restritiva e você pode usar pesos (adequados) que
                    você mesmo definir. Como são esses pesos
                    "CLIFF-ORD"? <br clear="none">
                    <br clear="none">
                    Elias<br clear="none">
                    <br clear="none">
                    <div class="yiv7115735874yqt3929151011"
                      id="yiv7115735874yqt93730">
                      <div class="yiv7115735874moz-cite-prefix">On
                        20/11/2017 18:10, Edimeire Alexandra Pinto via
                        R-br wrote:<br clear="none">
                      </div>
                      <blockquote type="cite"> </blockquote>
                    </div>
                  </div>
                  <div class="yiv7115735874yqt3929151011"
                    id="yiv7115735874yqt88986">
                    <div>
                      <div>
                        <div
                          id="yiv7115735874yui_3_16_0_ym19_1_1511207855320_2550">Boa
                          tarde, pessoal.</div>
                        <div
                          id="yiv7115735874yui_3_16_0_ym19_1_1511207855320_2550"><br
                            clear="none">
                        </div>
                        <div dir="ltr"
                          id="yiv7115735874yui_3_16_0_ym19_1_1511207855320_2550">Alguém
                          por acaso sabe com se trabalha com modelos
                          "parecidos" com CLIFF-ORD usando spreg  do
                          pacote sphet? Sei que o Stata faz, mas
                          gostaria de fazer no R.  Estou trabalhando com
                          vários tipos de modelos espaciais (na
                          realidade, quase todos do pacote sphet) e esse
                          me gerou muita dúvida, pois preciso de que uma
                          das variaveis explicativas com e sem peso
                          espacial da matriz W.</div>
                        <div dir="ltr"
                          id="yiv7115735874yui_3_16_0_ym19_1_1511207855320_2550"><br
                            clear="none">
                        </div>
                        <div dir="ltr"
                          id="yiv7115735874yui_3_16_0_ym19_1_1511207855320_2550">Por
                          exemplo, acrescentando peso espacial a uma das
                          variaveis explicativas do modelo.</div>
                        <div dir="ltr"
                          id="yiv7115735874yui_3_16_0_ym19_1_1511207855320_2550"><br
                            clear="none">
                        </div>
                        <div dir="ltr"
                          id="yiv7115735874yui_3_16_0_ym19_1_1511207855320_2550"><span
id="yiv7115735874yui_3_16_0_ym19_1_1511207855320_5827">library</span><span
id="yiv7115735874yui_3_16_0_ym19_1_1511207855320_5828">(spdep)
                            data(columbus)
                            listw<-nb2listw(col.gal.nb)</span></div>
                        <div dir="ltr"
                          id="yiv7115735874yui_3_16_0_ym19_1_1511207855320_2550"><span
id="yiv7115735874yui_3_16_0_ym19_1_1511207855320_20356"><span
                              id="yiv7115735874yui_3_16_0_ym19_1_1511207855320_20348">res1<-
                              spreg(CRIME~HOVAL + INC+ INC,
                              data=columbus , listw= listw, het = TRUE,
                              verbose = FALSE,model="sarar") res2<-
                              spreg(CRIME~HOVAL + INC+ WINC,
                              data=columbus , listw= listw, het = </span></span><span
id="yiv7115735874yui_3_16_0_ym19_1_1511207855320_5829">TRUE</span><span
id="yiv7115735874yui_3_16_0_ym19_1_1511207855320_5830">, verbose = </span><span
id="yiv7115735874yui_3_16_0_ym19_1_1511207855320_5831">FALSE,model="sarar"</span><span
id="yiv7115735874yui_3_16_0_ym19_1_1511207855320_5832">) ### WINC é o
                            peso espacial multiplicado #pelo variavel
                            INC, especie de W*INC</span><br
                            id="yiv7115735874yui_3_16_0_ym19_1_1511207855320_13872"
                            clear="none">
                        </div>
                        <div dir="ltr"
                          id="yiv7115735874yui_3_16_0_ym19_1_1511207855320_2550"><span><br
                              clear="none">
                          </span></div>
                        <div dir="ltr"
                          id="yiv7115735874yui_3_16_0_ym19_1_1511207855320_2550"><span
id="yiv7115735874yui_3_16_0_ym19_1_1511207855320_21938">ou mesmo</span></div>
                        <div dir="ltr"
                          id="yiv7115735874yui_3_16_0_ym19_1_1511207855320_2550"><span><br
                              clear="none">
                          </span></div>
                        <div dir="ltr"
                          id="yiv7115735874yui_3_16_0_ym19_1_1511207855320_2550"><span
id="yiv7115735874yui_3_16_0_ym19_1_1511207855320_15477">res3<-
                            spreg(CRIME~HOVAL + INC+WINC, data=columbus
                            , listw= listw, het = </span><span
                            id="yiv7115735874yui_3_16_0_ym19_1_1511207855320_15478">TRUE</span><span
id="yiv7115735874yui_3_16_0_ym19_1_1511207855320_15479">, verbose = </span><span
id="yiv7115735874yui_3_16_0_ym19_1_1511207855320_15480">FALSE,model="error"</span><span
id="yiv7115735874yui_3_16_0_ym19_1_1511207855320_15481">) </span><span><br
                              clear="none">
                          </span></div>
                        <div dir="ltr"
                          id="yiv7115735874yui_3_16_0_ym19_1_1511207855320_2550"><span><br
                              clear="none">
                          </span></div>
                        <div dir="ltr"
                          id="yiv7115735874yui_3_16_0_ym19_1_1511207855320_2550"><br
                            clear="none">
                        </div>
                      </div>
                      <br clear="none">
                      <fieldset
                        class="yiv7115735874mimeAttachmentHeader"></fieldset>
                      <br clear="none">
                      <pre>_______________________________________________
R-br mailing list
<a rel="nofollow" shape="rect" class="yiv7115735874moz-txt-link-abbreviated" ymailto="mailto:R-br@listas.c3sl.ufpr.br" target="_blank" href="mailto:R-br@listas.c3sl.ufpr.br" moz-do-not-send="true">R-br@listas.c3sl.ufpr.br</a>
<a rel="nofollow" shape="rect" class="yiv7115735874moz-txt-link-freetext" target="_blank" href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" moz-do-not-send="true">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a>
Leia o guia de postagem (<a rel="nofollow" shape="rect" class="yiv7115735874moz-txt-link-freetext" target="_blank" href="http://www.leg.ufpr.br/r-br-guia" moz-do-not-send="true">http://www.leg.ufpr.br/r-br-guia</a>) e forne�a c�digo m�nimo reproduz�vel.</pre>
                      <br clear="none">
                    </div>
                  </div>
                </div>
                <div class="yqt3929151011" id="yqt27137">_______________________________________________<br
                    clear="none">
                  R-br mailing list<br clear="none">
                  <a shape="rect"
                    ymailto="mailto:R-br@listas.c3sl.ufpr.br"
                    href="mailto:R-br@listas.c3sl.ufpr.br"
                    moz-do-not-send="true">R-br@listas.c3sl.ufpr.br</a><br
                    clear="none">
                  <a shape="rect"
                    href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br"
                    target="_blank" moz-do-not-send="true">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br
                    clear="none">
                  Leia o guia de postagem (<a shape="rect"
                    href="http://www.leg.ufpr.br/r-br-guia"
                    target="_blank" moz-do-not-send="true">http://www.leg.ufpr.br/r-br-guia</a>)
                  e forne�a c�digo m�nimo reproduz�vel.</div>
                <br>
                <br>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>