Wls regression

#1
How do we compute the weights in WLS regression? Step by step explanation would be really helpful.
After, we compute the weight then how to do we use it to run the regression?
 

Dason

Ambassador to the humans
#2
It depends on why you're using WLS in the first place. Sometimes you're using it because each observation is actually an average and you want to account for the fact that each observation might have different sample sizes associated with it. Some methods dynamically compute the weights to account for something like heteroskedasticity.