Summary of Subgroups
Have a look at aggregate in base r or ddply in plyr package. Chris Howden Founding Partner Tricky Solutions Tricky Solutions 4 Tricky Problems Evidence Based Strategic Development, IP Commercialisation and Innovation, Data Analysis, Modelling and Training (mobile) 0410 689 945 (fax / office) chris at trickysolutions.com.au Disclaimer: The information in this email and any attachments to it are confidential and may contain legally privileged information. If you are not the named or intended recipient, please delete this communication and contact us immediately. Please note you are not authorised to copy, use or disclose this communication or any attachments without our consent. Although this email has been checked by anti-virus software, there is a risk that email messages may be corrupted or infected by viruses or other interferences. No responsibility is accepted for such interference. Unless expressly stated, the views of the writer are not those of the company. Tricky Solutions always does our best to provide accurate forecasts and analyses based on the data supplied, however it is possible that some important predictors were not included in the data sent to us. Information provided by us should not be solely relied upon when making decisions and clients should use their own judgement.
On 8 Aug 2014, at 9:19, Shankar Lanke <shankarlanke at gmail.com> wrote: Dear R group, I have a query about summarizing the sub groups. I want to calculate mean or median of BMI & SWTZ of ID 1 to 3 as shown in below table. Actually I have 4500 ID's. I appreciate your assistance and guidance. ID BMI SWTZ 1 22.3 97.7 1 22.3 116 1 22.3 116 1 22.3 110.8 1 22.3 110.8 2 27.3 135.8 2 23 119 2 29.4 65.4 2 29.4 65.4 2 29.4 65.4 3 22.3 128.1 3 22.3 128.1 3 22.3 128.1 3 22.3 128.1 3 22.3 114.7 Thank you very much in advance. -- Regards, [[alternative HTML version deleted]]
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models