Is there a way to run the
sem function (R sem package) by using WLS method?
Furthermore I have a very small data set (20 observations), can I overcome this problem by using a bootstrapping technique?
I'm not particularly familiar with the sem package, but I do know that the lavaan package offers a WLS estimation method for cfa and sem models. It should all be described in the relevant documentation.
As for the use of bootstrapping, I'm not familiar enough with the theory, but I would tend to avoid such methods with such a tiny sample.
Yes. Take a look at the Fml objective function in the code. It's totally my bad that there isn't a WLS function yet as it's been low on my coding priority list, but, it should be fairly simple to implement. The trick is going to be writing the weighting function, but, once you do that, it should be straightforward to plus it in and specify the new objective. sem has just been re-written so that ANY objective function can be slotted in as long as you can write it using the same framework as the Fml objective function.
Also, note, the lavaan package already has WLS incorporated.