0

I would like to remove the chief physicians from the characteristic professional position and remove the characteristic employed from the characteristic employment relationship (self-employed or employed). Subsequently, all employed chief physicians are to be compared with all other employed physicians without the professional position of chief physician. I now have the difficulty how to represent this in a contingency table, let alone in a barplot.

First, I thought about creating two dataframes. Is it possible to proceed like this? Subsequently, one could do this in the table function? But it is not working...

Chefarzt<-subset(daten0,Position.EM=="Chefarzt",Arbeitsverhaeltnis.EM=="angestellt")
Aerzte<- subset(daten0, Position.EM!="Chefarzt",Arbeitsverhaeltnis.EM=="angestellt")

Chefarzt <- as.factor(daten0$Chefarzt)
Aerzte<- as.factor(daten0$Aerzte)

tabChefAe<-table(daten0$Chefarzt,daten0$Aerzte)
tabChefAe

result: table of extent 0 x 0 >

user438383
  • 4,338
  • 6
  • 23
  • 35
  • 2
    Welcome. You will have to be a **lot** more clear about your question - we have no idea what 'remove the chief physicians from the characteristic professional position' means, for example. Please share a reproducible example of your data and provide some kind of expected output. Thanks. – user438383 Nov 04 '21 at 17:18
  • 1
    It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. – MrFlick Nov 04 '21 at 17:59
  • Check your code. `variable – Ray Nov 04 '21 at 18:38

0 Answers0