sqlocpoly              package:surveyNG              R Documentation

_S_m_o_o_t_h_i_n_g

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

     This function performs weighted density estimation and smoothing,
     using the binned local polynomial smoothers in the 'KernSmooth'
     package.

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

     sqlocpoly(formula, design, bandwidth, M = 401)

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

 formula: One-sided formula for density estimation, two-sided for
          smoothing 

  design: 'sqlsurvey' object 

bandwidth: Smoothing bandwidth 

       M: Number of grid points

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

     The binning is performed in SQL, so for large data sets the
     computation time is roughly linear in 'M' and in the number of
     observations. 'M' should be a few times larger than
     'range(x)/bandwidth', but can often be reduced from the default
     value.

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

     An object of class 'svysmooth'

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

     'sqlsurvey'

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

     sqclus1<-sqlsurvey(id="dnum", fpc="fpc", weights="pw", strata="fpc",
        data=system.file("apiclus1.db",package="surveyNG"),
        table.name="clus1", key="snum")

     dens <- sqlocpoly(~api00, sqclus1, bandwidth=50)
     smooth <- sqlocpoly(api00~api99, sqclus1, bandwidth=50)

     dens
     plot(dens)
     plot(smooth)

     close(sqclus1)

