Reputation: 171
I have my dataset called IMS, consisting of 11 variables. strong text
I would like to compute the mean for the variable std.y for all observations where the variable pi == 1.
Anyone who can tell me how to compute this? :)
Best Regards, Henrik
Upvotes: 0
Views: 4611
Reputation: 17412
mean(IMS$std.y[IMS$pi==1])
This is something you can get from most introductory texts on R - I'd recommend you look through those before posting questions here.
Upvotes: 6