Kuv yuav tshem tawm qhov tseem ceeb hauv R li cas?
Kuv yuav tshem tawm qhov tseem ceeb hauv R li cas?

Video: Kuv yuav tshem tawm qhov tseem ceeb hauv R li cas?

Video: Kuv yuav tshem tawm qhov tseem ceeb hauv R li cas?
Video: QHIA QHOV TSEEB - KUB VAJ LOOG TSUA NEW MUSIC VIDEO 2022 2024, Plaub Hlis Ntuj
Anonim

Ua ntej, yog peb xav tshem tawm tsis muaj nuj nqis los ntawm kev ua lej siv cov na . rm = TRUE argument. Yog koj tsis cais cov no tus nqi feem ntau functions yuav rov qab ib NA . Peb kuj tuaj yeem xav hloov pauv peb cov ntaub ntawv kom tau txais kev soj ntsuam tiav, cov kev soj ntsuam (kab) hauv peb cov ntaub ntawv uas muaj no cov ntaub ntawv uas ploj lawm.

Tsuas yog li ntawd, R ua li cas cov txiaj ntsig uas ploj lawm?

Hauv R tus tsis muaj nuj nqis yog coded los ntawm lub cim NA . Txhawm rau txheeb xyuas qhov uas ploj lawm hauv koj lub dataset lub luag haujlwm yog. na (). Thaum koj import dataset los ntawm lwm cov ntaub ntawv txheeb cais cov tsis muaj nuj nqis tej zaum yuav raug coded nrog tus lej, piv txwv li 99. Yuav kom cia R paub tias yog a tsis muaj nqi koj yuav tsum tau recode nws.

Tsis tas li ntawd, koj yuav ua li cas tsis lees paub qhov tseem ceeb hauv R? Kev daws cov ntaub ntawv ploj lawm siv R

  1. colsum(is.na(data frame))
  2. sum(is.na(data frame$column name)
  3. Cov txiaj ntsig uas ploj lawm tuaj yeem kho tau siv cov hauv qab no:
  4. Lub ntsiab lus / Hom / Nruab Nrab Imputation: Imputation yog ib txoj hauv kev los sau cov txiaj ntsig uas ploj lawm nrog cov kwv yees.
  5. Prediction Model: Prediction model yog ib txoj hauv kev zoo tshaj plaws los tuav cov ntaub ntawv uas ploj lawm.

Tom qab ntawd, ib tus tuaj yeem nug, kuv yuav tshem tawm cov kab uas muaj NA qhov tseem ceeb hauv R li cas?

omit() muaj nuj nqi rov qab ib daim ntawv tsis muaj kab uas muaj cov nqi . Hla koj cov ntaub ntawv ncej los ntawm lub na . omit() muaj nuj nqi yog ib txoj hauv kev yooj yim los ntxuav cov ntaub ntawv tsis tiav los ntawm koj qhov kev tshuaj xyuas. Nws yog qhov ua tau zoo txoj kev tshem tawm cov nqi hauv r.

Yuav ua li cas tshem tawm outliers los ntawm cov ntaub ntawv teev nyob rau hauv R?

Tsis muaj qhov tshwj xeeb R ua haujlwm rau tshem tawm outliers . Koj yuav tsum xub paub seb qhov kev soj ntsuam yog dab tsi outliers thiab tom qab ntawd tshem tawm lawv, i.e. nrhiav thawj thiab thib peb quartile (cov pob khawm) thiab cov interquartile ntau los txhais cov lej ntawm cov laj kab sab hauv.

Pom zoo: