Hi you all,
I need some help, as i'm a begginer using R. I have two objects in my data.frame, named "homens" e "mulheres" (male and female observations). For each of them, I have the log-hourly wages (called logsalh). I have to create a new variable of earnings which is the loghourly wage weighted by a other column (called "pesop"), that is in each data.frame (for men and women).
I've tried this commands, but it failed:
logsalhpm <-transform(mulheres$logsalh mulheres$pesop, logsalhp=(mulheres$logsalh)*(mulheres$pesop)/sum(mulheres$pesop))
where "logsalp" is the name of the new variable of earnings, weighted.
Could somenone please help me?
Best wishes, Raquel
[[alternative HTML version deleted]]
Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Archive generated by hypermail 2.2.0, at Thu 21 Jun 2007 - 16:32:06 GMT.
Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.