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

  • Home
  • SEARCH
  • 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 6883949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:26:49+00:00 2026-05-27T05:26:49+00:00

I’m sure this is an easy command in R, but for some reason, I’m

  • 0

I’m sure this is an easy command in R, but for some reason, I’m having trouble finding a solution.

I’m trying to run a bunch of crosstabs (using the table() command) in R, and each tab has two columns (treatment and no treatment). I would like to know if the difference between the columns are significantly different for each other for all rows (the rows are a handful of answer choices from a survey). I’m not interested in overall significance, only within the crosstab comparing treatment vs. no treatment.

This type of analysis is very easy in SPSS (link below to illustrate what I’m talking about), but I can’t seem to get it working in R. Do you know I can do this?

http://help.vovici.net/robohelp/robohelp/server/general/projects_fhpro/survey_workbench_MX/Significance_testing.htm

EDITED:
Here is an example of in R about what I mean:

 treatmentVar <-c(0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1) # treatment is 1 or 0
 question1 <-c(1,2,2,3,1,1,2,2,3,1,1,2,2,3,1,3) #choices available are 1, 2, or 3
 Questiontab <- table(question1, treatmentVar)
 Questiontab

I have tables like this ^ (percentaged by column on the treatmentVar), and I would like to see if there is a significant difference between each question choice (rows) going from treatment 0 to treatment 1. So in the example above, I would want to know if there is a significant difference between 4 and 2 (row 1), 3 and 3 (row 2), and 1 and 3 (row 3). So in this example, the choices for question1 might be significantly difference for choices 1 and 3 (because the difference is 2) but the difference for choice 2 isn’t because the difference is zero. Ultimately, I’m trying to determine this type of significance. I hope that helps.

Thanks!

  • 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-05-27T05:26:49+00:00Added an answer on May 27, 2026 at 5:26 am

    Using your example, either the chisq.test or prop.test (equivalent in this case):

    > chisq.test(Questiontab)
    
            Pearson's Chi-squared test
    
    data:  Questiontab 
    X-squared = 1.6667, df = 2, p-value = 0.4346
    
    Warning message:
    In chisq.test(Questiontab) : Chi-squared approximation may be incorrect
    > prop.test(Questiontab)
    
            3-sample test for equality of proportions without continuity
            correction
    
    data:  Questiontab 
    X-squared = 1.6667, df = 2, p-value = 0.4346
    alternative hypothesis: two.sided 
    sample estimates:
       prop 1    prop 2    prop 3 
    0.6666667 0.5000000 0.2500000 
    
    Warning message:
    In prop.test(Questiontab) : Chi-squared approximation may be incorrect
    

    Note the warning; these tests aren’t necessarily appropriate for such small numbers.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I am trying to loop through a bunch of documents I have to put
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has

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.