Plotting bargraph with SE and alphabets in R | LSD test

Поделиться
HTML-код
  • Опубликовано: 12 июл 2024
  • You can learn how to map a bar graph with main and interaction effects in this video. The following subjects will be included in the video tutorial:
    1:10 Importing data and formatting variables
    1:55 Analysis of variance model
    2:42 LSD mean comparison test
    4:29 Arranging treatment groups from LSD test
    5:28 Computing mean and standard error
    6:28 Visualizing bar plots
    =============
    Download Links
    =============
    Download R-script & data file ⁠- visit this blog:
    agroninfotech.blogspot.com/20...
    Updated blog post link:
    www.agroninfo.com/bar-plot-se...
    R is free software and you can download it from the link given below
    www.r-project.org/
    Download link for R studio
    www.rstudio.com/products/rstu...
    ___________________________________________
    ====================
    Get connected with us on
    ====================
    Website: www.agroninfo.com/analysis/r-...
    Facebook page: / agroninfotech
    Twitter: / agroninfotech
    Linked In: / agron-info-tech-7429a6156
    ____________________________________________
    If you have any question please comment below.
    Thanks for watching this video.
    #R
    #barplot
    #bargraph
    #ggbiplot

Комментарии • 81

  • @rafaelandreshernandezsalaz1701
    @rafaelandreshernandezsalaz1701 3 года назад +1

    Man you saved me!! I love your videos and your channel is full of useful content for a newbie in R like me. Keep it going,
    Best regards from Colombia,
    Rafael

  • @elbertkendricks5652
    @elbertkendricks5652 2 года назад +1

    Thank you. I browse your blog and find this video. Now I have understood these R codes, and I am able to visualise the results of two-way ANNOVA analysis.

  • @jhoandysroyet4667
    @jhoandysroyet4667 3 года назад +1

    Excelente video, espero que hayan mucha mas en el futuro, muchas gracias.

  • @anastasiiagryshyna6637
    @anastasiiagryshyna6637 3 года назад +2

    Thank you so much for this video! I have been having issues with attaching letters above error bars to represent the statistical significance and this video helped me so much!!!

    • @AGRONInfoTech
      @AGRONInfoTech  3 года назад

      You are most welcome. Thank you for appreciation.

  • @priscillaadisa5909
    @priscillaadisa5909 3 года назад +1

    Very interesting. Thanks so much

  • @richardmose9266
    @richardmose9266 3 года назад +1

    Very helpful, thanks

  • @bkarim7349
    @bkarim7349 Год назад +1

    great video thanks

  • @sunkumargurung1172
    @sunkumargurung1172 2 года назад +1

    Thanks AGRON

  • @omniaarief7923
    @omniaarief7923 Год назад

    Excellent video. Could you inform me about the script for calculations for lsd value instead of groups? Thanks in advance

  • @RidgyULRASite
    @RidgyULRASite 3 года назад

    Thank you! I have a problem in the interaction term at 4:10 when trying to use my code: "Error in soil:ion : Argument NA/NaN"" -> I had to build a new variable which considers both parameters (is this correct)

    • @AGRONInfoTech
      @AGRONInfoTech  3 года назад +2

      Mask the components data object before ANOVA using below command and then it will work.
      data$soil = as.factor(data$soil)
      data$ion = as.factor(data$ion)
      attach(data)
      Then proceed with ANOVA and mean separation test

  • @ozgurates1840
    @ozgurates1840 Год назад

    thank you, sir. Do you help me with the same issue with boxplot instead of bargraph ? Thank you so much.

    • @AGRONInfoTech
      @AGRONInfoTech  Год назад

      Okay just share your Rscript code and data at agroninfotech@gmail.com

  • @gizieabeje7932
    @gizieabeje7932 3 года назад +1

    Very interesting lectures. Thank you in advance! Using this video, I was tried my data to do the LSD but during the interaction effect (i.e. LSD_AB; it shows an error-Genotypes: TRT: NA/NaN argument). Can you please help me ?

    • @AGRONInfoTech
      @AGRONInfoTech  3 года назад

      Can you please send me str(data) result at agron.infotech@gmail.com
      R is case sensitive and make sure while using the interaction term in trt argument (trt = factorA : factorB,) you entered the variable names correctly.

    • @AGRONInfoTech
      @AGRONInfoTech  3 года назад

      For more details also visit this blog post: agroninfotech.blogspot.com/2020/08/barplot-for-main-and-interaction.html

    • @gizieabeje7932
      @gizieabeje7932 3 года назад

      I sent it to your email. kindly please check it!

    • @AGRONInfoTech
      @AGRONInfoTech  3 года назад

      See inbox please

    • @e.miguelangelromeroucharic69
      @e.miguelangelromeroucharic69 3 года назад

      @@AGRONInfoTech I have the same error please help me. I'm worried. I will wait for your answer.

  • @eastcuisines124
    @eastcuisines124 3 года назад

    this is exactly what i was looking for...but im having trouble at the geom_errobar(aes .. can you please give a link the example you excecuted in r? please

    • @AGRONInfoTech
      @AGRONInfoTech  3 года назад +1

      You can download R script and example data set from the link provided in description. When you will open this link a blog post will appear and at the end of this post you will get the download links.

    • @eastcuisines124
      @eastcuisines124 3 года назад +1

      @@AGRONInfoTech ooh thanks a lot..it worked!

    • @AGRONInfoTech
      @AGRONInfoTech  3 года назад

      You are most welcome

  • @hasibulhasan2447
    @hasibulhasan2447 2 года назад

    I have a problem in the interaction term at 4:10 when trying to use my code: "Error in soil:ion : Argument NA/NaN"" .....what i have to do?

    • @AGRONInfoTech
      @AGRONInfoTech  2 года назад

      Before ANOVA please run following commands:
      data$soil = as.factor(data$soil)
      data$ion = as.factor(data$ion)
      attach(data)
      Where data specify object containing data set which was imported from excel sheet.
      If still have issues please let me know

  • @md.shahiniqbal7850
    @md.shahiniqbal7850 3 года назад

    Hi
    Thanks for your efforts. It is very helpful and easy to follow. Could you please give me the code on how can I give LSD Bar (Interaction LSD Value) at the top of the graph?

    • @md.shahiniqbal7850
      @md.shahiniqbal7850 3 года назад

      ruclips.net/video/s8MJdOTnrCA/видео.html you can see an example in this vedio

    • @AGRONInfoTech
      @AGRONInfoTech  3 года назад

      Please click the link given in description of this video. It's a blog post link where you will get all details and download links for R script and data file is given at the end of each the post.

  • @RidgyULRASite
    @RidgyULRASite 3 года назад

    Would it work as well with kruskal-wallis or wilcoxon when normality is not achieved?

  • @deryaakpinar5412
    @deryaakpinar5412 Год назад

    Thank you very much for the helpful instruction. It is very helpful! I am trying to run the code, however, I do see the same error as others saw before: Although I put the comment before I run the Anova as:
    (data$genotype=as.factor(data$genotype)
    (data$gender=as.factor(data$gender)
    attach(data)
    I receive the error that said " the following objects are masked from data: activity,gender,genotype?
    I need help figuring out where I am wrong. Please help me to fix it.

    • @AGRONInfoTech
      @AGRONInfoTech  Год назад

      This is not an error. It's just a message when you use the attach() function. If you are still not clear then share with me the script and data at agroninfotech@gmail.com and I shall send you the required output

  • @subhradips7183
    @subhradips7183 2 года назад +1

    I have tried to use the same method for RBD anova followed by LSD post hoc and lastly bargraph with errorbar and SE. I have 18 treatments. However after plotting the treatment order was not same as input order. how to rearrange it?

    • @AGRONInfoTech
      @AGRONInfoTech  2 года назад +1

      I have received your email and shall work on the files you have provided. I shall return the files with corrected codes on Sunday.

    • @subhradips7183
      @subhradips7183 2 года назад

      @@AGRONInfoTech many many thanks

  • @alokjayara3631
    @alokjayara3631 11 месяцев назад

    Sir, Can you share the video for error bars and significant letters for strip plot design.

    • @AGRONInfoTech
      @AGRONInfoTech  11 месяцев назад

      I just went through your email. I think there is some issue with the codes that you have used to create this barplot. I can better correct the codes if you can share the data file and script you have used to create this plot.

  • @dembadiakhate9329
    @dembadiakhate9329 Год назад

    dear professor can you use the methode for split plot for putting the letter a, b, c

    • @AGRONInfoTech
      @AGRONInfoTech  Год назад

      Sure I shall add a video later. However if you need it urgently you can share your dataset and details at below email and I shall send you script with analysis and visualizing variables with error and letters on each bar using ggplot2 package.
      agron.infotech@gmail.com

    • @dembadiakhate9329
      @dembadiakhate9329 Год назад

      Give me your email adress i will share to you the data excel and CV

  • @vincenzozammuto7037
    @vincenzozammuto7037 2 года назад

    Thank you so much for this video however an Error occurred when the LSD_AB line run: "Error in genotype:gender : NA/NaN argument
    In addition: Warning messages:
    1: In genotype:gender :
    numerical expression has 18 elements: only the first used
    2: In genotype:gender :
    numerical expression has 18 elements: only the first used
    3: In data.frame(y, trt) : NAs introduced by coercion
    4: In data.frame(y, trt) : NAs introduced by coercion" could you help me to understand it?

    • @AGRONInfoTech
      @AGRONInfoTech  2 года назад

      Before ANOVA please run following commands:
      data$genotype = as.factor(data$genotype)
      data$gender = as.factor(data$gender)
      attach(data)
      Where data specify object containing data set which was imported from excel sheet.
      If still have issues please let me know

  • @yenealemalemneh8957
    @yenealemalemneh8957 10 месяцев назад

    thank you instructor, my analysis shows " object plot A not found" don't show plot or bargraph after " print(p1) run

    • @AGRONInfoTech
      @AGRONInfoTech  10 месяцев назад

      Sorry for the delay in response. You can share your script at agron.infotech@gmail.com

  • @alokjayara3631
    @alokjayara3631 11 месяцев назад

    MeanSE_A = data %>%
    + group_by(pho) %>%
    + summarise(avg_A = mean(val),
    + se = sd(val)/sqrt(length(val)))
    Error in UseMethod("group_by") :
    no applicable method for 'group_by' applied to an object of class "function"
    PLEASE RESOLVE

  • @kyawminyun
    @kyawminyun 3 года назад

    I couldn't access R script and example data from the links you provided. Please let me know how to get it. Thanks.

    • @AGRONInfoTech
      @AGRONInfoTech  3 года назад

      Share your email address and i shall send you through email

    • @kyawminyun
      @kyawminyun 3 года назад

      @@AGRONInfoTech k.mintun08@gmail.com

    • @AGRONInfoTech
      @AGRONInfoTech  3 года назад

      See your inbox please

    • @isaacbalume8771
      @isaacbalume8771 3 года назад

      @@AGRONInfoTech i.balume@gmail.com , please sent to me too this is very important

    • @kyawminyun
      @kyawminyun 3 года назад

      @@isaacbalume8771
      Error came out after running:
      LSD_AB = LSD.test(y = activity,
      trt = genotype:gender,
      DFerror = aov.res$df.residual,
      MSerror = deviance(aov.res)/aov.res$df.residual,
      alpha = 0.05,
      p.adj = "bonferroni",
      group = TRUE,
      console = TRUE)
      The problem is:
      Error in genotype:gender : NA/NaN argument
      In addition: Warning messages:
      1: In genotype:gender :
      numerical expression has 18 elements: only the first used
      2: In genotype:gender :
      numerical expression has 18 elements: only the first used
      3: In data.frame(y, trt) : NAs introduced by coercion
      4: In data.frame(y, trt) : NAs introduced by coercion

  • @mulisafaji882
    @mulisafaji882 Год назад +1

    How can I do two dependent variables within one bar chart

    • @AGRONInfoTech
      @AGRONInfoTech  Год назад

      I shall create a separate video on this soon

    • @mulisafaji882
      @mulisafaji882 Год назад

      @@AGRONInfoTech Ok I wait for that

  • @amandabueno1913
    @amandabueno1913 3 года назад

    How can I do this with just 1 group? just with "Female" for example.

    • @AGRONInfoTech
      @AGRONInfoTech  2 года назад

      You can filter data before proceeding for analysis. Use below command:
      library(tidyr)
      data2 = filter(data, gender == "Female")
      Then work on data2 to plot a graph

  • @lovegardening-yeulamvuon7262
    @lovegardening-yeulamvuon7262 3 года назад

    I don't know where I did wrong." colon.pc" data type is numeric
    > comp1 = LSD.test(y=colon.pc,
    + trt = Substrate,
    + DFerror = m1$df.residual,
    + MSerror = deviance(m1)/m1$df.residual,
    + alpha = 0.05,
    + p.adj = "bonferroni",
    + group = TRUE,
    + console = TRUE)
    Error in "aov" %in% class(y) : object 'colon.pc' not found

    • @AGRONInfoTech
      @AGRONInfoTech  3 года назад

      The error indicates you have not attached the components of data file using attach() function. If you are using y argument (y = colon.pc) where colon.pc is response variable name then you need to do either of the following:
      Use attach(data) to attach the colon.pc component of the data file if you are just trying to simply use the name of the variable
      Use y = data$colon.pc if you are not using attach function.
      Hope this will fix the error. If you still have the error please let me know.

    • @lovegardening-yeulamvuon7262
      @lovegardening-yeulamvuon7262 3 года назад

      @@AGRONInfoTech It works !!! Thanks heaps

    • @AGRONInfoTech
      @AGRONInfoTech  3 года назад +1

      You are welcome

  • @barshasharma582
    @barshasharma582 3 года назад

    Can you help me with my data in split split plot

    • @AGRONInfoTech
      @AGRONInfoTech  3 года назад

      Why not. Just let me know what issue you are facing in this analysis

  • @shinhyelee3169
    @shinhyelee3169 3 года назад +1

    Thank you for your teaching. I wanted to download the data file, but it was not possible. So, I made a data frame that is the same as your data. I hope it is also helpful to others. If you feel uncomfortable, I will delete this comment
    data

    • @AGRONInfoTech
      @AGRONInfoTech  3 года назад

      Thank you. I shall try to embed data set and Rscript so that login may not be required to download these files.

  • @emilymasinde7465
    @emilymasinde7465 Год назад

    Hi, Kindly assist. I've been analyzing the data using your guidance but i'm getting "NA/NaN argument" at the point of analysing the interactions. Below is the command for interaction between clone and season and i'm getting the error message so i can't proceed with analysis. LSD_AB=LSD.test(y=rootweight,trt=clone:season,DFerror=aov.res$df.residual,MSerror=deviance(aov.res)/aov.res$df.residual,alpha=0.05, p.adj="bonferroni",group=TRUE,console=TRUE)

    • @AGRONInfoTech
      @AGRONInfoTech  Год назад

      Send me data and code you have used at agroninfotech@gmail.com