Calculate Mean of Data Frame Column in R (6 Examples) | mean, summarise of dplyr, colMeans & na.rm

  Рет қаралды 20,241

Statistics Globe

Statistics Globe

Күн бұрын

Пікірлер: 45
@j-beryl15
@j-beryl15 2 жыл бұрын
I invested too many hours watching R videos with 'hundred-thousands views' and alas, your video solved my puzzle. Thank you
@StatisticsGlobe
@StatisticsGlobe 2 жыл бұрын
Thank you, glad it helped! :)
@juanvega6027
@juanvega6027 Жыл бұрын
I just recently discovered your channel and I have to say, I love the content. I've learned a lot because you explain everything in detail and go through examples. You have my subscription lol I hope to continue learning more from you!!
@matthias.statisticsglobe
@matthias.statisticsglobe Жыл бұрын
Hi Juan! Thanks for the amazing comment, great to hear that our channel is that helpful for you! We try our best to keep it up that way;) If you have any questions/suggestions, please let us know!
@bmh4248
@bmh4248 3 жыл бұрын
Thanks a lot for your content !!!! You are helping a lot of data professionals and data students.
@StatisticsGlobe
@StatisticsGlobe 3 жыл бұрын
Glad you think so mate! Thanks a lot for the kind words :)
@Adeyeye_seyison
@Adeyeye_seyison Жыл бұрын
Thanks a million sir, For the effort,time invested and the VALUE you are ADDING to us!
@matthias.statisticsglobe
@matthias.statisticsglobe Жыл бұрын
You are very welcome, Seyison! Thanks for the motivating words and your support!
@dominiquebarrette9621
@dominiquebarrette9621 2 жыл бұрын
Thank you for your videos they are so helpful and you teach so well however in my data frame, my rows have 5 treatments and in each treatment, I have 3 results - how can I calculate the mean per treatment without having to separate each treatment - thank you and best regards
@StatisticsGlobe
@StatisticsGlobe 2 жыл бұрын
Thank you so much for the wonderful feedback Dominique! You can calculate the mean by group as shown here: statisticsglobe.com/mean-by-group-in-r
@danishrizwan8251
@danishrizwan8251 Жыл бұрын
If I go to heaven, I will take you with me!
@matthias.statisticsglobe
@matthias.statisticsglobe Жыл бұрын
:D That would be great!!
@sabaamir5304
@sabaamir5304 Жыл бұрын
thanks for your tutorials. I watched several of them but am still unsure how to calculate the mean for specific levels of different factors. for example, I want the mean of reaction_time for task A (in the factor task which is a column in data just the participants who did A ), and for correct trials(there is another factor called to answer and I want only the correct one to be calculated not wrongs). I would appreciate you introducing a function.
@cansustatisticsglobe
@cansustatisticsglobe Жыл бұрын
Hello Saba, You can use the group_by() function to implement statistical operations by the factor levels. See our tutorial: statisticsglobe.com/mean-by-group-in-r Regards, Cansu
@ElDominator1
@ElDominator1 Жыл бұрын
Hello! Thanks for the video. I have a dataset with just 4 rows which I want to average, but across thousands of columns. Is there a way to simultaneously average all rows under each column, so that I have just one row of means under my thousands of columns?
@cansustatisticsglobe
@cansustatisticsglobe Жыл бұрын
Hello, I think you can use the following code to implement it. data
@shivamshinde9810
@shivamshinde9810 3 жыл бұрын
This is pretty good even for revision of learned concepts...
@StatisticsGlobe
@StatisticsGlobe 3 жыл бұрын
Thanks a lot Shivham, glad it helped! :)
@larissacury7714
@larissacury7714 2 жыл бұрын
Thank you very much! However, what if I need to calculate the mean of two collumns like this: (Same task, two teachers) Teacher 1 Teacher 2 MEAN 5 6 5.5 6 7 6.5 7 8 7.5
@larissacury7714
@larissacury7714 2 жыл бұрын
Would it work: data$mean
@StatisticsGlobe
@StatisticsGlobe 2 жыл бұрын
Hey Larissa, exactly, this is how it should work.
@larissacury7714
@larissacury7714 2 жыл бұрын
@@StatisticsGlobe thank you!!
@StatisticsGlobe
@StatisticsGlobe 2 жыл бұрын
You are very welcome! :)
@lorenzkarl175
@lorenzkarl175 2 жыл бұрын
I would have a question. What if i want to calculate several means within one column. For example i have following dataset: Colour Number Black 2 Black 4 Brown 6 Brown 3 Black 6 Brown 3 And i want to calculate the mean for Black and for Brown. Thx in advance!
@StatisticsGlobe
@StatisticsGlobe 2 жыл бұрын
Hey Lorenz, please have a look at this tutorial: statisticsglobe.com/mean-by-group-in-r Regards, Joachim
@lorenzkarl175
@lorenzkarl175 2 жыл бұрын
@@StatisticsGlobe You are amazing Joachim! Thx a lot
@StatisticsGlobe
@StatisticsGlobe 2 жыл бұрын
You are very welcome Lorenz, glad it helped! :)
@andreitomescu7847
@andreitomescu7847 3 жыл бұрын
Thanks for the video
@StatisticsGlobe
@StatisticsGlobe 3 жыл бұрын
Thanks Andrei, glad you liked it!
@zakjay6748
@zakjay6748 3 жыл бұрын
what if I want to calculate mean of particular item from the column "word" in 2 different conditions, for example cond word rt A 8 10 B 8 19
@StatisticsGlobe
@StatisticsGlobe 3 жыл бұрын
Hey Zak, I'm not sure if I understand your question correctly. Could you illustrate the desired result of your example data?
@michaelelias85x65
@michaelelias85x65 3 жыл бұрын
Tank you ..
@StatisticsGlobe
@StatisticsGlobe 3 жыл бұрын
You are very welcome Michael! :)
@alestamegayat4342
@alestamegayat4342 2 жыл бұрын
Why dont you show how to exclude few columns and take the means of the rest seperately? And other thing is getting the mean of only numerics. And the laat thing is combinjng the two?
@StatisticsGlobe
@StatisticsGlobe 2 жыл бұрын
Hey Alesta, I have plenty of other tutorials that can be combined with this one. For instance: statisticsglobe.com/extract-certain-columns-of-data-frame-in-r statisticsglobe.com/select-only-numeric-columns-from-data-frame-in-r Regards, Joachim
@arthygunam5685
@arthygunam5685 3 жыл бұрын
How to calculate the mean of selected column ? I have 5 columns but I want the mean of last 3 columns
@StatisticsGlobe
@StatisticsGlobe 3 жыл бұрын
Hey Arthy, please try this: colMeans(data[ , (ncol(data) - 2):ncol(data)])
@arthygunam5685
@arthygunam5685 3 жыл бұрын
@@StatisticsGlobe thankyou very much sir
@StatisticsGlobe
@StatisticsGlobe 3 жыл бұрын
You are very welcome Arthy!
@Hassan_MM.
@Hassan_MM. Жыл бұрын
Wanna Create Only Deviations from Mean for Entire Column❓️
@cansustatisticsglobe
@cansustatisticsglobe Жыл бұрын
Hello Hassan, Do you want to calculate the differences from the mean for each entry in a column? Best, Cansu
@Hassan_MM.
@Hassan_MM. Жыл бұрын
@cansustatisticsglobe Yes ✔️,Exactly for few Columns only,then will Square those values for Entire column to do away with Negative Sign if any,Kindly Help How its Done ❓️
@cansustatisticsglobe
@cansustatisticsglobe Жыл бұрын
Hello @@Hassan_MM., I think you can simply implement this: # Example data frame df
@Hassan_MM.
@Hassan_MM. Жыл бұрын
@@cansustatisticsglobe That's Works Magic 💯♥️ Thanks✔️
@cansustatisticsglobe
@cansustatisticsglobe Жыл бұрын
Perfect! Welcome @@Hassan_MM..
How to calculate column mean & mean for sub-groups in R or RStudio
26:32
Minukuu Tutorials
Рет қаралды 9 М.
They Chose Kindness Over Abuse in Their Team #shorts
00:20
I migliori trucchetti di Fabiosa
Рет қаралды 4 МЛН
бабл ти гель для душа // Eva mash
01:00
EVA mash
Рет қаралды 7 МЛН
Человек паук уже не тот
00:32
Miracle
Рет қаралды 3,4 МЛН
Handling NA in R | is.na, na.omit & na.rm Functions for Missing Values
6:19
Grouping and Summarizing Data Using dplyr
13:54
weecology
Рет қаралды 10 М.
Manipulate your data.   Data wrangling.   R programmning for beginners.
29:59
R Programming 101
Рет қаралды 79 М.
How to calculate row mean or mean of a selection of rows in R
24:19
Minukuu Tutorials
Рет қаралды 12 М.
How He Got $600,000 Data Engineer Job
19:08
Sundas Khalid
Рет қаралды 153 М.
Mean and Standard Deviation in R
8:48
DiagKNOWstics Learning
Рет қаралды 17 М.
How I'd Learn Data Analytics in 2024 (If I Had to Start Over)
14:08
CareerFoundry
Рет қаралды 814 М.
They Chose Kindness Over Abuse in Their Team #shorts
00:20
I migliori trucchetti di Fabiosa
Рет қаралды 4 МЛН