sam() and sampling weights

17 views
Skip to first unread message

Kyle Cox

unread,
Apr 16, 2026, 3:57:56 PM (10 days ago) Apr 16
to lavaan
Hi all,
I'm looking into SAM approaches that incorporate sampling weights. It seems like the sam() function accommodates sampling weights but I want to confirm this is accurate. Specifically, if the default LSAM approach accommodates sampling weights and how. I couldn't find any publication/presentation that described the method the sam() function uses to incorporate the sampling weights.
Thanks,
Kyle Cox

Felipe Vieira

unread,
Apr 16, 2026, 5:45:49 PM (10 days ago) Apr 16
to lav...@googlegroups.com
Hi Kyle, 

As far as I know, you can pass the weights through the argument "sampling.weights" (it gets forwarded through ... ). For example, see documentation pages 4 (and 47 for some information on normalization). However, from my current understanding of the code, I am not entirely sure how the SEs incorporate that information/work in that case.

A simple example:

pop.model <- '
  f1 =~ 0.1*x1 + 0.2*x2 + 0.3*x3
  f2 =~ 0.1*y1 + 0.2*y2 + 0.3*y3
  f2 ~ 0.4*f1
'

Data <- simulateData(pop.model, sample.nobs = 1000, seed = 1234)
Data$wt <- ifelse(Data$y1 > 0, 2, 1)

model <- '
  f1 =~ x1 + x2 + x3
  f2 =~ y1 + y2 + y3
  f2 ~ f1
'
fit_nowt <- sam(model, data = Data); fit_wt   <- sam(model, data = Data, sampling.weights = "wt")
coef(fit_nowt); coef(fit_wt)

Best, 
Felipe. 

--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/lavaan/198b824a-1104-4e6d-89b2-07c31790fa46n%40googlegroups.com.

Felipe Vieira

unread,
Apr 16, 2026, 5:52:37 PM (10 days ago) Apr 16
to lav...@googlegroups.com
Hi Kyle, 

As far as I know, you can pass the weights through the argument "sampling.weights" (it gets forwarded through ... ). For example, see documentation pages 4 (and 47 for some information on normalization). However, from my current understanding of the code, I am not entirely sure how the SEs incorporate that information/work in that case.

A simple example:

pop.model <- '
  f1 =~ 1*x1 + 2*x2 + 3*x3
  f2 =~ 1*y1 + 2*y2 + 3*y3
  f2 ~ 4*f1
'

Data <- simulateData(pop.model, sample.nobs = 1000, seed = 1234)
Data$wt <- ifelse(Data$y1 > 0, 2, 1)

model <- '
  f1 =~ x1 + x2 + x3
  f2 =~ y1 + y2 + y3
  f2 ~ f1
'
fit_nowt <- sam(model, data = Data); fit_wt   <- sam(model, data = Data, sampling.weights = "wt")
coef(fit_nowt); coef(fit_wt)

Best, 
Felipe.
On Thu, Apr 16, 2026 at 9:57 PM Kyle Cox <kyle...@gmail.com> wrote:
--
Reply all
Reply to author
Forward
0 new messages