mirror of
https://github.com/agdamsbo/daDoctoR.git
synced 2024-11-24 12:41:54 +01:00
update to counting
This commit is contained in:
parent
1dbe5976e0
commit
24a7f6ffc8
@ -50,12 +50,12 @@ strobe_olr<-function(meas,var,adj,data,dec=2){
|
|||||||
nr<-c()
|
nr<-c()
|
||||||
|
|
||||||
for (r in 1:length(levels(dat[,2]))){
|
for (r in 1:length(levels(dat[,2]))){
|
||||||
vr<-levels(dat[,2])[r]
|
vr<-levels(mn$model[,2])[r]
|
||||||
dr<-dat[dat[,2]==vr&!is.na(dat[,2]),]
|
dr<-mn$model[mn$model[,2]==vr,]
|
||||||
n<-as.numeric(nrow(dr))
|
n<-as.numeric(nrow(dr))
|
||||||
|
|
||||||
## Af en eller anden grund bliver der talt for mange med.
|
## Af en eller anden grund bliver der talt for mange med.
|
||||||
nall<-as.numeric(nrow(dat[!is.na(dat[,2]),]))
|
nall<-as.numeric(nrow(mn$model))
|
||||||
nl<-levels(m)[r]
|
nl<-levels(m)[r]
|
||||||
pro<-round(n/nall*100,0)
|
pro<-round(n/nall*100,0)
|
||||||
rt<-paste0(n," (",pro,"%)")
|
rt<-paste0(n," (",pro,"%)")
|
||||||
@ -88,13 +88,13 @@ strobe_olr<-function(meas,var,adj,data,dec=2){
|
|||||||
|
|
||||||
for (i in 1:ncol(dat2)){
|
for (i in 1:ncol(dat2)){
|
||||||
if (is.factor(dat2[,i])){
|
if (is.factor(dat2[,i])){
|
||||||
vec<-dat2[,i]
|
vec<-ma$model[,i]
|
||||||
ns<-names(dat2)[i]
|
ns<-names(dat2)[i]
|
||||||
for (r in 1:length(levels(vec))){
|
for (r in 1:length(levels(vec))){
|
||||||
vr<-levels(vec)[r]
|
vr<-levels(vec)[r]
|
||||||
dr<-vec[vec==vr&!is.na(vec)]
|
dr<-vec[vec==vr]
|
||||||
n<-as.numeric(length(dr))
|
n<-as.numeric(length(dr))
|
||||||
nall<-as.numeric(nrow(dat[!is.na(dat2[,c(ns)]),]))
|
nall<-as.numeric(nrow(ma$model))
|
||||||
nl<-paste0(ns,levels(vec)[r])
|
nl<-paste0(ns,levels(vec)[r])
|
||||||
pro<-round(n/nall*100,0)
|
pro<-round(n/nall*100,0)
|
||||||
rt<-paste0(n," (",pro,"%)")
|
rt<-paste0(n," (",pro,"%)")
|
||||||
@ -104,8 +104,8 @@ strobe_olr<-function(meas,var,adj,data,dec=2){
|
|||||||
if (!is.factor(dat2[,i])){
|
if (!is.factor(dat2[,i])){
|
||||||
num<-dat2[,i]
|
num<-dat2[,i]
|
||||||
ns<-names(dat2)[i]
|
ns<-names(dat2)[i]
|
||||||
n<-as.numeric(nrow(dat[!is.na(dat2[,c(ns)]),]))
|
n<-as.numeric(nrow(ma$model))
|
||||||
nall<-as.numeric(nrow(dat))
|
nall<-as.numeric(nrow(ma$model))
|
||||||
pro<-round(n/nall*100,0)
|
pro<-round(n/nall*100,0)
|
||||||
rt<-paste0(n," (",pro,"%)")
|
rt<-paste0(n," (",pro,"%)")
|
||||||
nq<-rbind(nq,cbind(ns,rt))
|
nq<-rbind(nq,cbind(ns,rt))
|
||||||
|
Loading…
Reference in New Issue
Block a user