Questions tagged [crosstable]

For questions related to crosstable::crosstable() and gmodels::CrossTable(). Be sure to also include the [r] tag on your question.

A crosstable is a table that contains descriptive statistics and common statistical tests. Several R packages propose their interface, mostly crosstable and gmodels.

Read the documentation:

25 questions
0
votes
1 answer

Repeated haven_labelled error. What am I not doing correctly?

I am relatively inexperience in r and am trying to do work that's relatively simple, but get repeated similar errors. For example, I am working with a dataset and trying to generate a simple crosstabulation of two variables using crosstable in an…
0
votes
0 answers

Combining surveys with distinct analytical weights in Stata

I have a dataset which combine 14 household surveys in 14 countries. Each survey was conducted in different years and each survey has a household weight variable that only specifies to this country's context (data structure is the same across 14…
Ferdinand
  • 1
  • 2
0
votes
1 answer

How to reformat existing dataframe

I have following dataframe in python: geographical area area deep indoor pop deeep indoor area indoor pop indoor area incar pop incar A 1 2 3 4 5 6 B 7 8 9 10 11 12 C 13 14 15 16 17 18 and the idea is to convert it somehow to…
Moose
  • 11
  • 1
0
votes
1 answer

argument drop.empty not working in sjt.xtab function from sjPlot package

Lets say I have a factor level that I need to delete for the analysis for whatever reasons. I make a subset, but the factor level still exists. Luckily, there is an argument in sjt.xtab that specifies: drop.empty: Logical, if TRUE and the…
0
votes
1 answer

Crosstable package on R: How to only show percentages?

How do I only show percentages with the crosstable() function on R? I don't want the numbers to show on my example below. Here's an example of my code: control <- crosstable(ce_merged, c(msgctrl1_emotion, msgctrl2_emotion, msgctrl3_emotion,…
0
votes
2 answers

Using loops to create multiple crosstables in R

I have a dataset with one main categorical outcome variable and multiple categorical exposure variables. I'd like to generate a series of individual crosstabs with Chi Square tests for each exposure variable, and I'm wondering if there's a way to do…
Shannon
  • 93
  • 8
0
votes
1 answer

How to use weight with the package "crsosstable" for R

The crosstable package give me exactly what I need to do some exploratory work in a data set composed of answers to a survey. But I need to weight the crosstabulation to get a representative results of the population I'm studying. Any ideas how I…
0
votes
1 answer

Crosstable on multiple rows in PostgreSQL

Hi I want to know how can do a pivot table with crosstable in a table like: user_id action time 1 a 2022-01-01 12:30 1 b 2022-01-01 12:40 1 b 2022-01-01 12:50 1 c 2022-01-01 13:00 1 c 2022-01-01 13:10 1 c 2022-01-01…
0
votes
1 answer

Frequency counts with a "multiple selection" variable

I have a dataframe with three variables: ID Gender (m,f,d) Medication (1,2,3,4,5,6,7,8,9,10) For "Medication" multiple selections were possible in the questionnaire so now there are several numbers in each cell of the dataframe (separated by…
0
votes
0 answers

Object not found in CrossTable

I have data of a Likert scale questionnaire regarding alcohol consumption and cigarette smoking. I want to look for a correlation between the 2 variables in R but I am a complete R newbie and don’t understand why it doesn’t work. The code I…
1
2