lnam                   package:sna                   R Documentation

_F_i_t _a _L_i_n_e_a_r _N_e_t_w_o_r_k _A_u_t_o_c_o_r_r_e_l_a_t_i_o_n _M_o_d_e_l

_D_e_s_c_r_i_p_t_i_o_n:

     'lnam' is used to fit linear network autocorrelation models. 
     These include standard OLS as a special case, although 'lm' is to
     be preferred for such analyses.

_U_s_a_g_e:

     lnam(y, x = NULL, W1 = NULL, W2 = NULL, theta.seed = NULL, 
         null.model = c("meanstd", "mean", "std", "none"), method = "BFGS", 
         control = list())

_A_r_g_u_m_e_n_t_s:

       y: a vector of responses. 

       x: a vector or matrix of covariates; if the latter, each column
          should contain a single covariate. 

      W1: a (possibly valued) adjacency matrix on the elements of 'y'. 

      W2: another (possibly valued) adjacency matrix on the elements of
          'y'. 

theta.seed: an optional seed value for 'optim'. 

null.model: the null model to be fit; must be one of '"meanstd"',
          '"mean"', '"std"', or '"none"'. 

  method: method to be used with 'optim'. 

 control: optional control parameters for 'optim'. 

_D_e_t_a_i_l_s:

     'lnam' fits the linear network autocorrelation model given by


    y = rho1 * W1 %*% y + X %*% beta + e, e = rho2 * W2 %*% e + nu


     where y is a vector of responses, X is a covariate matrix, W1 and
     W2 are (possibly valued) adjacency matrices, and nu ~
     Norm(0,sigma^2).  Intuitively, rho1 is an ``AR''-like parameter
     (parameterizing the autoregression of each y value on its
     neighbors in W1) while rho2 is an ``MA''-like parameter
     (parameterizing the autocorrelation of each _disturbance_ in y on
     its neighbors in W2).  In general, the two models are distinct,
     and either or both effects may be selected by including the
     appropriate matrix arguments.

     Model parameters are estimated by maximum likelihood, and
     asymptotic standard errors are provided as well; all of the above
     (and more) can be obtained by means of the appropriate 'print' and
     'summary' methods.  A plotting method is also provided, which
     supplies fit basic diagnostics for the estimated model.  For
     purposes of comparison, fits may be evaluated against one of four
     null models:

        1.  'meanstd': mean and standard deviation estimated (default).

        2.  'mean': mean estimated; standard deviation assumed equal to
           1.

        3.  'std': standard deviation estimated; mean assumed equal to
           0.

        4.  'none': no parameters estimated; data assumed to be drawn
           from a standard normal density.

     The default setting should be appropriate for the vast majority of
     cases, although the others may have use when fitting ``pure''
     autoregressive models (e.g., without covariates).  Although a
     major use of the 'lnam' is in controlling for network
     autocorrelation within a regression context, the model is subtle
     and has a variety of uses.  (See the references below for
     suggestions.)

_V_a_l_u_e:

     An object of class '"lnam"' containing the following elements:

       y: the response vector used.

       x: if supplied, the coefficient matrix.

      W1: if supplied, the W1 matrix.

      W2: if supplied, the W2 matrix.

   model: a code indicating the model terms fit.

 infomat: the estimated Fisher information matrix for the fitted model.

    acvm: the estimated asymptotic covariance matrix for the model
          parameters.

null.model: a string indicating the null model fit.

lnlik.null: the log-likelihood of y under the null model.

df.null.resid: the residual degrees of freedom under the null model.

 df.null: the model degrees of freedom under the null model.

null.param: parameter estimates for the null model.

lnlik.model: the log-likelihood of y under the fitted model.

df.model: the model degrees of freedom.

df.residual: the residual degrees of freedom.

df.total: the total degrees of freedom.

    rho1: if applicable, the MLE for rho1.

 rho1.se: if applicable, the asymptotic standard error for rho1.

    rho2: if applicable, the MLE for rho2.

 rho2.se: if applicable, the asymptotic standard error for rho2.

   sigma: the MLE for sigma.

sigma.se: the standard error for sigma

    beta: if applicable, the MLE for beta.

 beta.se: if applicable, the asymptotic standard errors for beta.

fitted.values: the fitted mean values.

residuals: the residuals (response minus fitted); note that these
          correspond to e-hat in the model equation, not nu-hat.

disturbances: the estimated disturbances, i.e., nu-hat.

    call: the matched call.

_N_o_t_e:

     Actual optimization is performed by calls to 'optim'.  Information
     on algorithms and control parameters can be found via the
     appropriate man pages.

_A_u_t_h_o_r(_s):

     Carter T. Butts buttsc@uci.edu

_R_e_f_e_r_e_n_c_e_s:

     Leenders, T.Th.A.J.  (2002)  ``Modeling Social Influence Through
     Network Autocorrelation: Constructing the Weight Matrix''  _Social
     Networks_, 24(1), 21-47. 

     Anselin, L.  (1988)  _Spatial Econometrics: Methods and Models._ 
     Norwell, MA: Kluwer.

_S_e_e _A_l_s_o:

     'lm', 'optim'

_E_x_a_m_p_l_e_s:

     #Construct a simple, random example:
     w1<-rgraph(100)               #Draw the AR matrix
     w2<-rgraph(100)               #Draw the MA matrix
     x<-matrix(rnorm(100*5),100,5) #Draw some covariates
     r1<-0.2                       #Set the model parameters
     r2<-0.1
     sigma<-0.1
     beta<-rnorm(5)
     #Assemble y from its components:
     nu<-rnorm(100,0,sigma)          #Draw the disturbances
     e<-qr.solve(diag(100)-r2*w2,nu) #Draw the effective errors
     y<-qr.solve(diag(100)-r1*w1,x%*%beta+e)  #Compute y

     #Now, fit the autocorrelation model:
     fit<-lnam(y,x,w1,w2)
     summary(fit)
     plot(fit)

