Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7782213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:28:12+00:00 2026-06-01T19:28:12+00:00

So I have a table with two columns; treatments in the first and responses

  • 0

So I have a table with two columns; treatments in the first and responses in the second, called V1 and V2 (the default). I tried

aov.ex2 = aov(V2~V1, data=ex2)
summary(aov.ex2)

and got something really strange — only 1 d.f. for the sum of squares for treatments, despite the fact that there should be 30 - 1 = 29 d.f. Doing V1~V2 gives me the same result. What am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T19:28:13+00:00Added an answer on June 1, 2026 at 7:28 pm

    To expand on @MYaseen208’s response:

    Back in the old days computer programs did not deal well with non-numeric data, so it was common to recode categorical variables as numeric variables to enter the data into the computer. These programs then needed the user to tell them that this variable that looks like a numeric variable is really representing categories. This can be done in either of 2 ways: as an attribute of the data, or an attribute of the analysis. R takes the approach that things like this are attributes of the data rather than the analysis (which makes a lot more sense to me) so the aov function does not have any arguments to specify which predictors are categorical but rather looks at the data to determine this. Since the aov function can also do analysis of covariance and more general linear models it can accept both categorical and numeric predictors (so will not assume everything is categorical). You did not tell us how you entered your data, but however you did it it looked like numeric data to R and you never told it otherwise so it keeps assuming that it is numeric. You need to tell R that it is categorical factor(V1). It is possible to do this with every analysis, but it is better to do it once, either when creating/reading the data or once right after ex2$V2 <- factor(ex2$V2) so that every analysis/graph/summary on this data realizes that it is categorical and treats it appropriately.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a tree table with two columns on a page. The first one
I have a table with two columns, like this: Firstname: Jeff Where the first
I have a table with two columns. Items in the first column represent one
I have simple table with two columns: id INTEGER as a key, and data
Say I have a table with two columns called A, and B. I want
Imagine I have a table with two columns, a primary key and some data.
I have a table with two columns. The first (which contains a menu) should
i have a table with two columns first column is a (currentdate)timestamp and the
I have a table with two columns: #MY_DATA * ID * DATA How can
I have a table with only two columns . i want to make first

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.