QQ කුමන්ත්‍රණයක් අර්ථ නිරූපණය කරන්නේ කෙසේද?


184

මම කුඩා දත්ත කට්ටලයක් සමඟ (නිරීක්ෂණ 21 ක්) වැඩ කරන අතර R හි පහත දැක්වෙන සාමාන්‍ය QQ බිම් කොටස ඇත:

රූප විස්තරය මෙහි ඇතුළත් කරන්න

කුමන්ත්‍රණය සාමාන්‍ය තත්වයට සහාය නොදක්වන බව දුටු විට, යටින් පවතින ව්‍යාප්තිය ගැන මට කුමක් කිව හැකිද? මට පෙනෙන පරිදි බෙදා හැරීම දකුණට වඩා ඇලවීම වඩා හොඳ සුදුසුකමක් වනු ඇත, එය හරිද? එසේම, දත්ත වලින් අපට ලබා ගත හැකි වෙනත් නිගමන මොනවාද?


9
එය නිවැරදි වක්‍රතාවයක් පෙන්නුම් කරන බව ඔබ නිවැරදිය. QQ බිම් කොටස් අර්ථ නිරූපණය කිරීම පිළිබඳ ලිපි කිහිපයක් සොයා ගැනීමට මම උත්සාහ කරමි.
Glen_b -Reinstate Monica

3
ඔබ නිගමනය කළ යුතු නැත; ඊළඟට කුමක් උත්සාහ කළ යුතු දැයි ඔබ තීරණය කළ යුතුය. මෙහිදී මම වර්ග වර්ග කිරීම හෝ දත්ත ලොග් වීම සලකා බලමි.
නික් කොක්ස්

11
(-1.5,2)(1.5,220 යි)(0,70 යි)

3
@Glen_b මගේ ප්‍රශ්නයට පිළිතුරට යම් තොරතුරු තිබේ: stats.stackexchange.com/questions/71065/… සහ පිළිතුරෙහි ඇති සබැඳියට තවත් හොඳ ප්‍රභවයක් ඇත: stats.stackexchange.com/questions/52212/qq-plot-does-not -match-histogram
tpg2114

මේ ගැන කුමක් කිව හැකිද? QQ කුමන්ත්‍රණය නොතාරිස් ලෙස බෙදා හරින ලද දත්ත පෙන්වන්නේද? ! රූප විස්තරය මෙහි ඇතුළත් කරන්න
ඩේවිඩ්

Answers:


310

අගයන් රේඛාවක් දිගේ පිහිටා තිබේ නම්, බෙදාහැරීම අප සිතූ න්‍යායාත්මක ව්‍යාප්තියට සමාන හැඩයක් (පිහිටීම හා පරිමාණය දක්වා) ඇත.

දේශීය හැසිරීම : y- අක්ෂය මත වර්ග කළ නියැදි අගයන් සහ x- අක්ෂයේ (ආසන්න වශයෙන්) අපේක්ෂිත ප්‍රමාණ දෙස බලන විට, බිම් කොටසේ සමහර කොටස්වල අගයන් සමස්ත රේඛීය ප්‍රවණතාවයකින් දේශීයව වෙනස් වන්නේ කෙසේදැයි අපට හඳුනාගත හැකිය. කුමන්ත්‍රණයක එම කොටසේ න්‍යායාත්මක ව්‍යාප්තියට වඩා අගයන් වැඩි හෝ අඩු සංකේන්ද්‍රණය වී ඇත:

QQ බිම් කොටස් හතරෙන් කොටස්

අප දකින පරිදි, සමස්ත රේඛීය සම්බන්ධතාවයකට වඩා වේගයෙන් වැඩි වනවාට වඩා අඩු සාන්ද්‍රිත ලක්ෂ්‍ය වැඩි වැඩියෙන් සාන්ද්‍රිත ලක්ෂ්‍යයන් වැඩි වන අතර ආන්තික අවස්ථාවන්හි නියැදියේ ity නත්වයේ පරතරයට අනුරූප වේ (ආසන්න සිරස් පැනීමක් ලෙස පෙන්වයි) හෝ නියත අගයන්හි ස්පයික් (අගයන් තිරස් අතට පෙළගස්වා ඇත). මෙය අපට බර වලිගයක් හෝ සැහැල්ලු වලිගයක් හඳුනා ගැනීමට ඉඩ සලසයි. එබැවින් න්‍යායාත්මක ව්‍යාප්තියට වඩා විශාල හෝ කුඩා වක්‍රතාව සහ එසේ ය.

සමස්ත පෙනුම:

මෙහි QQ-ඉඩම් කට්ටි වගේ දේ (බෙදාහැරීමේ විශේෂ තේරීම් සඳහා) තියෙන්නේ සාමාන්යයෙන් :

රූප විස්තරය මෙහි ඇතුළත් කරන්න

නමුත් අහඹු ලෙස දේවල් අපැහැදිලි වේ, විශේෂයෙන් කුඩා සාම්පල සමඟ:

රූප විස්තරය මෙහි ඇතුළත් කරන්න

n=21

රූප විස්තරය මෙහි ඇතුළත් කරන්න

n=21

කිසියම් වක්රය හෝ විචක්ෂණ භාවය ගැන ඔබ කොතරම් කරදර විය යුතුද යන්න තීරණය කිරීමට උත්සාහ කිරීමේදී මෙහි ඇති යෝජනාව ඔබට ප්‍රයෝජනවත් විය හැකිය .

පොදුවේ අර්ථ නිරූපණය සඳහා වඩාත් සුදුසු මාර්ගෝපදේශයක් කුඩා හා විශාල නියැදි ප්‍රමාණවලින් දර්ශන ඇතුළත් වේ.


22
මෙය ඉතා ප්‍රායෝගික මාර්ගෝපදේශයකි, එම තොරතුරු රැස් කිරීම ගැන ඔබට බොහෝම ස්තූතියි.
JohnK

4
මෙහි වැදගත් දෙය රේඛීයතාවයෙන් හැඩය සහ අපගමනය බව මට වැටහී ඇත, නමුත් තවමත් අක්ෂ දෙකම "... ක්වොන්ටයිල්ස්" ලෙස ලේබල් කර ඇති අතර එක් අක්ෂයක් 0.2 0.4 0.6 ලෙසද අනෙක් අක්ෂය -2 -1 0 ලෙසද ගමන් කරයි. 1 2. නැවතත් සමහර දත්ත ලක්ෂ්‍යයන් න්‍යායාත්මක ව්‍යාප්තියක 40% ක් මැද ඇති බව පෙනේ, නමුත් ඔබේ පහළ-දකුණේ බොහෝ බිම් කොටසෙහි y- අක්ෂය යෝජනා කරන පරිදි ඒවා ඔවුන්ගේම බෙදාහරින්නාගෙන් 3% ක් අතර බෙදා හැරිය හැක්කේ කෙසේද?
මැකොන්ඩ්

2
AMacond y- අක්ෂය පෙන්වන්නේ දත්තවල අමු අගයන් මිස ඒවායේ ප්‍රමාණ නොවේ . Y- අක්ෂය ප්‍රමිතිකරණය කිරීමෙන් දේවල් වඩාත් පැහැදිලි වනු ඇති බවට මම එකඟ වෙමි , R පෙරනිමියෙන් මෙය නොකරන්නේ මන්දැයි මට අදහසක් නැත. යමෙකුට මේ පිළිබඳව යම් ආලෝකයක් හෙළි කළ හැකිද?
ගෝර්ඩන් ගුස්ටැෆ්සන්

4
Ord ගෝර්ඩන් ගුස්ටැෆ්සන් මැකොන්ඩ් වෙත ඔබ කළ පළමු අදහස් දැක්වීමට අදාළව ඔබ දත්ත ප්‍රමිතිකරණය නොකිරීමට හොඳ හේතුවක් තිබේ - මන්ද QQ කුමන්ත්‍රණයක් යනු දත්ත ප්‍රදර්ශනය කිරීමකි ! එය නිර්මාණය කර ඇත්තේ ඔබ ශ්‍රිතයට සපයන දත්තවල තොරතුරු පෙන්වීමටය (ඔබ බොක්ස්පොට් එකකට හෝ හිස්ටෝග්‍රැම් එකකට සපයන දත්ත ප්‍රමිතිකරණය කිරීම තරම් අර්ථවත් වනු ඇත). ඔබ එය පරිවර්තනය කරන්නේ නම්, එය තවදුරටත් දත්ත ප්‍රදර්ශනය කිරීමක් නොවේ (බිම් කොටසේ හැඩය සමාන විය හැකි නමුත්, ඔබ තවදුරටත් බිම් කොටසෙහි පිහිටීම හෝ පරිමාණය පෙන්වන්නේ නැත). ප්‍රමිතිගත කුමන්ත්‍රණයකින් එය වඩාත් පැහැදිලි වනු ඇතැයි ඔබ සිතන්නේ කුමක්දැයි මට විශ්වාස නැත - ඔබට පැහැදිලි කළ හැකිද?
ග්ලෙන්_බී -රයින්ස්ටේට් මොනිකා

2
@ සියාඕවේ නැත, නිල ඇඳුමක ඇත්ත වශයෙන්ම ඉතා සැහැල්ලු වලිග ඇත - තර්කානුකූලව, වලිග නැත. සෑම දෙයක්ම මධ්යයේ MADs 2 ක් තුළ ඇත. මෙම පිළිතුරේ පළමු ඡේදය 'බර-වලිගය' යන්නෙන් අදහස් කරන්නේ කුමක්ද යන්න ගැන සිතා බැලීමට පැහැදිලි, සාමාන්‍ය, ක්‍රමයක් ලබා දෙයි.
ග්ලෙන්_බී -රයින්ස්ටේට් මොනිකා

67

සාමාන්‍ය QQ කුමන්ත්‍රණය අර්ථ නිරූපණය කිරීම සඳහා මම දිලිසෙන යෙදුමක් සාදන ලදී. මෙම සබැඳිය උත්සාහ කරන්න .

මෙම යෙදුමේදී, ඔබට වක්‍රතාව, වලිගය (කර්ටෝසිස්) සහ දත්තවල මොඩියුලය වෙනස් කළ හැකි අතර, හිස්ටෝග්‍රැම් සහ QQ කුමන්ත්‍රණය වෙනස් වන ආකාරය ඔබට දැකගත හැකිය. අනෙක් අතට, ඔබට එය QQ කුමන්ත්‍රණයේ රටාව අනුව භාවිතා කළ හැකිය, ඉන්පසු වක්‍රතාව කෙසේ විය යුතුද යන්න පරීක්ෂා කරන්න.

වැඩි විස්තර සඳහා එහි ඇති ලියකියවිලි බලන්න.


මෙම යෙදුම මාර්ගගතව සැපයීමට මට ප්‍රමාණවත් ඉඩක් නොමැති බව මම තේරුම් ගතිමි. ඉල්ලීම පරිදි, මම කේත කුට්ටි තුනම ලබා දෙන්නෙමි : sample.R, server.Rසහ ui.Rමෙහි. මෙම යෙදුම ක්‍රියාත්මක කිරීමට උනන්දුවක් දක්වන අයට මෙම ලිපිගොනු Rstudio වෙත පටවා එය ඔබේම පරිගණකයකින් ක්‍රියාත්මක කළ හැකිය.

මෙම sample.Rගොනුව:

# Compute the positive part of a real number x, which is $\max(x, 0)$.
positive_part <- function(x) {ifelse(x > 0, x, 0)}

# This function generates n data points from some unimodal population.
# Input: ----------------------------------------------------
# n: sample size;
# mu: the mode of the population, default value is 0.
# skewness: the parameter that reflects the skewness of the distribution, note it is not
#           the exact skewness defined in statistics textbook, the default value is 0.
# tailedness: the parameter that reflects the tailedness of the distribution, note it is
#             not the exact kurtosis defined in textbook, the default value is 0.

# When all arguments take their default values, the data will be generated from standard 
# normal distribution.

random_sample <- function(n, mu = 0, skewness = 0, tailedness = 0){
  sigma = 1

  # The sampling scheme resembles the rejection sampling. For each step, an initial data point
  # was proposed, and it will be rejected or accepted based on the weights determined by the
  # skewness and tailedness of input. 
  reject_skewness <- function(x){
      scale = 1
      # if `skewness` > 0 (means data are right-skewed), then small values of x will be rejected
      # with higher probability.
      l <- exp(-scale * skewness * x)
      l/(1 + l)
  }

  reject_tailedness <- function(x){
      scale = 1
      # if `tailedness` < 0 (means data are lightly-tailed), then big values of x will be rejected with
      # higher probability.
      l <- exp(-scale * tailedness * abs(x))
      l/(1 + l)
  }

  # w is another layer option to control the tailedness, the higher the w is, the data will be
  # more heavily-tailed. 
  w = positive_part((1 - exp(-0.5 * tailedness)))/(1 + exp(-0.5 * tailedness))

  filter <- function(x){
    # The proposed data points will be accepted only if it satified the following condition, 
    # in which way we controlled the skewness and tailedness of data. (For example, the 
    # proposed data point will be rejected more frequently if it has higher skewness or
    # tailedness.)
    accept <- runif(length(x)) > reject_tailedness(x) * reject_skewness(x)
    x[accept]
  }

  result <- filter(mu + sigma * ((1 - w) * rnorm(n) + w * rt(n, 5)))
  # Keep generating data points until the length of data vector reaches n.
  while (length(result) < n) {
    result <- c(result, filter(mu + sigma * ((1 - w) * rnorm(n) + w * rt(n, 5))))
  }
  result[1:n]
}

multimodal <- function(n, Mu, skewness = 0, tailedness = 0) {
  # Deal with the bimodal case.
  mumu <- as.numeric(Mu %*% rmultinom(n, 1, rep(1, length(Mu))))
  mumu + random_sample(n, skewness = skewness, tailedness = tailedness)
}

මෙම server.Rගොනුව:

library(shiny)
# Need 'ggplot2' package to get a better aesthetic effect.
library(ggplot2)

# The 'sample.R' source code is used to generate data to be plotted, based on the input skewness, 
# tailedness and modality. For more information, see the source code in 'sample.R' code.
source("sample.R")

shinyServer(function(input, output) {
  # We generate 10000 data points from the distribution which reflects the specification of skewness,
  # tailedness and modality. 
  n = 10000

  # 'scale' is a parameter that controls the skewness and tailedness.
  scale = 1000

  # The `reactive` function is a trick to accelerate the app, which enables us only generate the data
  # once to plot two plots. The generated sample was stored in the `data` object to be called later.
  data <- reactive({
    # For `Unimodal` choice, we fix the mode at 0.
    if (input$modality == "Unimodal") {mu = 0}

    # For `Bimodal` choice, we fix the two modes at -2 and 2.
    if (input$modality == "Bimodal") {mu = c(-2, 2)}

    # Details will be explained in `sample.R` file.
    sample1 <- multimodal(n, mu, skewness = scale * input$skewness, tailedness = scale * input$kurtosis)
    data.frame(x = sample1)})

  output$histogram <- renderPlot({
    # Plot the histogram.
    ggplot(data(), aes(x = x)) + 
      geom_histogram(aes(y = ..density..), binwidth = .5, colour = "black", fill = "white") + 
      xlim(-6, 6) +
      # Overlay the density curve.
      geom_density(alpha = .5, fill = "blue") + ggtitle("Histogram of Data") + 
      theme(plot.title = element_text(lineheight = .8, face = "bold"))
  })

  output$qqplot <- renderPlot({
    # Plot the QQ plot.
    ggplot(data(), aes(sample = x)) + stat_qq() + ggtitle("QQplot of Data") + 
      theme(plot.title = element_text(lineheight=.8, face = "bold"))
    })
})

අවසාන වශයෙන්, ui.Rගොනුව:

library(shiny)

# Define UI for application that helps students interpret the pattern of (normal) QQ plots. 
# By using this app, we can show students the different patterns of QQ plots (and the histograms,
# for completeness) for different type of data distributions. For example, left skewed heavy tailed
# data, etc. 

# This app can be (and is encouraged to be) used in a reversed way, namely, show the QQ plot to the 
# students first, then tell them based on the pattern of the QQ plot, the data is right skewed, bimodal,
# heavy-tailed, etc.


shinyUI(fluidPage(
  # Application title
  titlePanel("Interpreting Normal QQ Plots"),

  sidebarLayout(
    sidebarPanel(
      # The first slider can control the skewness of input data. "-1" indicates the most left-skewed 
      # case while "1" indicates the most right-skewed case.
      sliderInput("skewness", "Skewness", min = -1, max = 1, value = 0, step = 0.1, ticks = FALSE),

      # The second slider can control the skewness of input data. "-1" indicates the most light tail
      # case while "1" indicates the most heavy tail case.
      sliderInput("kurtosis", "Tailedness", min = -1, max = 1, value = 0, step = 0.1, ticks = FALSE),

      # This selectbox allows user to choose the number of modes of data, two options are provided:
      # "Unimodal" and "Bimodal".
      selectInput("modality", label = "Modality", 
                  choices = c("Unimodal" = "Unimodal", "Bimodal" = "Bimodal"),
                  selected = "Unimodal"),
      br(),
      # The following helper information will be shown on the user interface to give necessary
      # information to help users understand sliders.
      helpText(p("The skewness of data is controlled by moving the", strong("Skewness"), "slider,", 
               "the left side means left skewed while the right side means right skewed."), 
               p("The tailedness of data is controlled by moving the", strong("Tailedness"), "slider,", 
                 "the left side means light tailed while the right side means heavy tailedd."),
               p("The modality of data is controlledy by selecting the modality from", strong("Modality"),
                 "select box.")
               )
  ),

  # The main panel outputs two plots. One plot is the histogram of data (with the nonparamteric density
  # curve overlaid), to get a better visualization, we restricted the range of x-axis to -6 to 6 so 
  # that part of the data will not be shown when heavy-tailed input is chosen. The other plot is the 
  # QQ plot of data, as convention, the x-axis is the theoretical quantiles for standard normal distri-
  # bution and the y-axis is the sample quantiles of data. 
  mainPanel(
    plotOutput("histogram"),
    plotOutput("qqplot")
  )
)
)
)

1
ඔබගේ දිලිසෙන යෙදුමේ ධාරිතාව උපරිම වී ඇති බව පෙනේ. සමහර විට ඔබට කේතය ලබා දිය හැකිය
rsoren

1
ඕර්සොරන් තවදුරටත් කියා සිටියේ එය උපකාරී වනු ඇතැයි මම බලාපොරොත්තු වන අතර මම යෝජනා අසන්නට බලාපොරොත්තු වෙමි.
ෂැන්සියොන්

ඉතා කදිමයි! නියැදි ප්‍රමාණය සහ අහඹු ලෙස වෙනස් කිරීම සඳහා විකල්ප එකතු කිරීමට ද මම යෝජනා කරමි.
ඉතමාර්

සබැඳිය නොමැත !!!! Han ෂැන්සියොන්ග්
අලිරේසා සනායි

සෑම මසකම සීමිත ක්ලික් කිරීම් ගණනකට පසුව සබැඳිය ප්‍රතිචාර දැක්වීමට අපොහොසත් වන බව පෙනේ. මම මෙහි ප්‍රභව කේතය ඇලවීමට හේතුව එයයි (ඔබ හා සමාන ගැටළුවක් ඇති වෙනත් පරිශීලකයින්ගේ ඉල්ලීම පරිදි). ඔබට ඒවා ඔබේ ආර් චිත්‍රාගාරයට ඇලවිය හැකි අතර ඒවා ඔබේම පරිගණකයකින් ධාවනය කළ හැකිය (අවශ්‍ය පැකේජ කල්තියා පටවා ගත් පසු).
ෂැන්සියොන්ග්

9

ඉතා ප්‍රයෝජනවත් (සහ අවබෝධාත්මක) පැහැදිලි කිරීමක් මහාචාර්ය විසින් දෙනු ලැබේ. MIT MOOC පා course මාලාවේ පිලිප් රිගොලට්: 18.650 යෙදුම් සඳහා සංඛ්‍යාලේඛන, 2016 වැටීම - විනාඩි 45 ට වීඩියෝව බලන්න

https://www.youtube.com/watch?v=vMaKx9fmJHE

ඔහුගේ සටහන මම ඉතා සටහන් කර ඇති අතර එය මගේ සටහන් වල තබා ඇත.

QQ බිම් සිතියම් සටහන

උදාහරණයක් ලෙස 1, ඉහළ වම් රූප සටහනේ, දකුණු වලිගයේ ආනුභවික (හෝ නියැදි) ප්‍රමාණාත්මක න්‍යායාත්මක ප්‍රමාණයට වඩා අඩු බව අපට පෙනේ

Qe <Qt

α

රූප විස්තරය මෙහි ඇතුළත් කරන්න


4

මෙම ත්‍රෙඩ් එක “සාමාන්‍ය qq බිම් කොටස අර්ථ නිරූපණය කරන්නේ කෙසේද” යන්න ස්ථිර යැයි සලකනු ලබන බැවින්, සාමාන්‍ය qq බිම් කොටස සහ අතිරික්ත කර්ටෝසිස් සංඛ්‍යාලේඛන අතර හොඳ, නිරවද්‍ය ගණිතමය සම්බන්ධතාවයක් පා readers කයන්ට පෙන්වා දීමට මම කැමැත්තෙමි.

මේ තියෙන්නේ:

https://stats.stackexchange.com/a/354076/102879

කෙටි (හා ඉතා සරල) සාරාංශයක් පහත පරිදි දක්වා ඇත (වඩාත් නිවැරදි ගණිත ප්‍රකාශ සඳහා සබැඳිය බලන්න): සාමාන්‍ය ප්‍රමාණයේ qq බිම් කොටසෙහි අතිරික්ත කර්ටෝසිස් ඔබට දැකිය හැකිය, දත්ත ප්‍රමාණ හා ඊට අනුරූප න්‍යායාත්මක සාමාන්‍ය ප්‍රමාණ අතර සාමාන්‍ය දුර, බරින් දත්ත වලින් මධ්‍යන්‍යයට ඇති දුර අනුව. මේ අනුව, qq බිම් කොටසේ වලිගවල නිරපේක්ෂ අගයන් සාමාන්‍යයෙන් අපේක්ෂිත සාමාන්‍ය අගයන්ගෙන් අන්ත දිශාවන්ගෙන් බොහෝ සෙයින් බැහැර වන විට, ඔබට ධනාත්මක අතිරික්ත කර්ටෝසිස් ඇත.

කුර්ටෝසිස් යනු මධ්‍යන්‍යයෙන් දුරින් ගණනය කරන ලද මෙම අපගමනයන්ගේ සාමාන්‍යය වන බැවින්, qq බිම් කොටසේ කේන්ද්‍රය අසල ඇති අගයන් කර්ටෝසිස් කෙරෙහි අඩු බලපෑමක් ඇති කරයි. එබැවින් අතිරික්ත කර්ටෝසිස් “උපරිමය” පවතින බෙදාහැරීමේ කේන්ද්‍රයට සම්බන්ධ නොවේ. ඒ වෙනුවට, අතිරික්ත කර්ටෝසිස් මුළුමනින්ම පාහේ තීරණය වන්නේ දත්ත බෙදාහැරීමේ වලිග සාමාන්‍ය බෙදාහැරීම හා සැසඳීමෙනි.

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.