+ Reply to Thread
Results 1 to 2 of 2

Thread: Help with linear model

  1. #1
    Points: 16, Level: 1
    Level completed: 31%, Points required for next Level: 34

    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help with linear model




    Hi guys, I'm really struggling with the relevant coding for this, I'm using Rstudio. I need a Linear model with Gaussian error structure to find whether a numerical variable (bacteria) is affected by concentrations of sucrose and leucine (categorical variables) using day (categorical variable as a main affect). Any help would be massively helpful.
    Thanks

  2. #2
    Points: 2,462, Level: 30
    Level completed: 8%, Points required for next Level: 138

    Posts
    200
    Thanks
    20
    Thanked 48 Times in 43 Posts

    Re: Help with linear model


    ##Adapted from:
    ## Annette Dobson (1990) "An Introduction to Generalized Linear Models".
    ## Page 9: Plant Weight Data.

    require(graphics)

    y<- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
    x <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)

    my_data <- data.frame(x=x,y=y)

    model<- lm(y ~ x,data=my_data)

    #Model validation:
    plot(model)

    #Model interpretation:
    summary(model)

+ Reply to Thread

           




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts






Advertise on Talk Stats