Re: [R] Generating weights based on certain condition in the dataset
On Jan 19, 2014, at 1:59 PM, Sudhi Upadhyaya wrote: Please delete this thread https://stat.ethz.ch/pipermail/r-help/2011-December/298414.html I already solved this problem and I forgot my login information so I am unable to login and delete this thread. Your password is automatically sent on a regular basis to the email address with which you subscribed. Postings are not deleted even upon request. [[alternative HTML version deleted]] -- David Winsemius, MD Alameda, CA, USA __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Generating weights based on certain condition in the dataset
Please delete this thread https://stat.ethz.ch/pipermail/r-help/2011-December/298414.html I already solved this problem and I forgot my login information so I am unable to login and delete this thread. Sincerely Sudhi [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Generating weights based on certain condition in the dataset
Dear all, My goal is to create weights. I have three covariates x1 x2 x3 These three covariates are discrete, they can only store either 1 or 0. So x1 x2 x3 -- 0 1 0 0 0 1 1 0 0 1 1 0 1 0 1 0 1 1 .. Sometimes they have missing data x1 x2 x3 -- 0 1 - 0 0 1 1 - 0 1 1 0 - 0 1 0 - - .. I need help to generate the following situation a) If there is a missing data then it can either be 0 0r 1. So lets consider the first row. The new program should create 2 new rows because x13 is missing. The two new rows should be like this x1 x2 x3 weight 0 1 0 w1=0.5 0 1 0 w2=0.5 0 0 1 1 - 0 1 1 0 - 0 1 0 - - .. Consider the last row. The last row contains two missing data. So the new program should create 4 new rows. The new rows should be like this. x1 x2 x3 weight 0 1 0 w1=0.5 0 1 0 w2=0.5 0 0 1 1 - 0 1 1 0 - 0 1 0 0 0 w1 =0.25 0 1 1 w2 =0.25 0 0 1 w3 =0.25 0 1 0 w4 =0.25 .. Also please see the image attached. Please let me know if you have more questions. Sincerely Sudhi Upadhyaya http://r.789695.n4.nabble.com/file/n4190948/weights.png weights.png -- View this message in context: http://r.789695.n4.nabble.com/Generating-weights-based-on-certain-condition-in-the-dataset-tp4190948p4190948.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.