title: How can I use likelihoods to compare these three groups? Should I want to do this?

text: **EDIT:** Perhaps I should also note that my initial attempt at analyzing this data used a hierarchical model in rJAGS sampling the means from uniform distributions and variances from gamma distributions but I found the choice of priors on the group level variance heavily influenced the results. Perhaps there is a better way to use that approach to estimate? Any advice on the best way to do this would be welcome. **End Edit** This question is related to these two previous questions of mine. @Elvis has suggested I turn it into its own question as the comments were getting lengthy: How to use profile likelihood? What is the relationship between profile likelihood and confidence intervals? I have data like the following based on animals performing a behavioral task: 1) Data can take any value from 0 to 20 2) Data from a relatively large number (~50) of previous results with control animals that indicates the expected distribution of results (at least for the control group) is not normal and looks like the top plot. 3) I have new data shown in the boxplots in the middle panel. Group 1 is a control that should be the same as the previous results (although no two groups of animals and conditions are ever _exactly_ the same). Group 2 is a control that received placebo treatment which is expected to have no effect, thus it should be the same as Group 1. Group 3 received a drug. 4) The goal of the study is to determine if the drug may be affecting the behavior of the animals. 5) There are many other factors that may affect the behavior of animals so it is the common assumption that the best that can be done is see if the drug affected the behavior _on average_. Thus I wish to compare the average outcomes of each group. 6) Previous studies have compared using one-way ANOVA and post-hoc t-tests then reporting p-values. This bothers me as the assumptions of the tests (normality) appear to be violated, using an arbitrary cutoff to decide "significance" (eg p<0.05) seems illogical, and I would never expect any two groups of animals to be exactly the same (null hypothesis of two means are equal is always false). Therefore I would like to instead simply estimate the means and show what means are most likely for each group using likelihoods and say something like the mean of group 3 is 20x more likely to be 15 than the mean of group 1. 7) I _may_ also/instead want to calculate confidence intervals for the means. It is not clear to me whether this is something I should want to do. 8) Note that this is not my actual data but was instead gotten by sampling from the "prior/previous" density, eg: `sample(x=prior.dens$x,size=12, prob=prior.dens$y)` So the appearance of a true difference between groups is false here. However this is very similar to the situation with my real data. 9) I have calculated the profile likelihood (lower plot) using this R code which appears to be valid based on the responses to my previous questions:               muVals <- seq(0,20, length = 10000)     profile.likelihood<-function(dat, muVals){       likVals <- sapply(muVals,                         function(mu){                           (sum((dat - mu)^2) /                              sum((dat - mean(dat))^2)) ^ (-length(dat)/2)                         }       )          return(cbind(muVals,likVals))     }      ![enter image description here](http://i.stack.imgur.com/wsmXv.png) **dput() of new data:**               structure(c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,      2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 13.6986301369863,      16.1643835616438, 12.0547945205479, 12.1722113502935, 9.74559686888454,      0.430528375733855, 11.3502935420744, 10.6457925636008, 9.9412915851272,      10.7240704500978, 10.958904109589, 11.6242661448141, 17.9701232444495,      15.9326690901071, 7.98247314058244, 14.4031004607677, 13.5198221541941,      2.82421704847366, 16.114045586437, 19.328767512925, 3.74181577004492,      17.4085859861225, 19.2017483590171, 8.26946665905416, 10.0207103956491,      16.1689247898757, 13.9989542039111, 9.80047978740185, 17.8596440777183,      18.1706223106012, 18.1891529858112, 11.7567204562947), .Dim = c(32L,      2L))      **dput() of prior density**               structure(list(x = c(0, 0.0391389432485323, 0.0782778864970646,      0.117416829745597, 0.156555772994129, 0.195694716242661, 0.234833659491194,      0.273972602739726, 0.313111545988258, 0.352250489236791, 0.391389432485323,      0.430528375733855, 0.469667318982387, 0.50880626223092, 0.547945205479452,      0.587084148727984, 0.626223091976517, 0.665362035225049, 0.704500978473581,      0.743639921722113, 0.782778864970646, 0.821917808219178, 0.86105675146771,      0.900195694716243, 0.939334637964775, 0.978473581213307, 1.01761252446184,      1.05675146771037, 1.0958904109589, 1.13502935420744, 1.17416829745597,      1.2133072407045, 1.25244618395303, 1.29158512720157, 1.3307240704501,      1.36986301369863, 1.40900195694716, 1.44814090019569, 1.48727984344423,      1.52641878669276, 1.56555772994129, 1.60469667318982, 1.64383561643836,      1.68297455968689, 1.72211350293542, 1.76125244618395, 1.80039138943249,      1.83953033268102, 1.87866927592955, 1.91780821917808, 1.95694716242661,      1.99608610567515, 2.03522504892368, 2.07436399217221, 2.11350293542074,      2.15264187866928, 2.19178082191781, 2.23091976516634, 2.27005870841487,      2.30919765166341, 2.34833659491194, 2.38747553816047, 2.426614481409,      2.46575342465753, 2.50489236790607, 2.5440313111546, 2.58317025440313,      2.62230919765166, 2.6614481409002, 2.70058708414873, 2.73972602739726,      2.77886497064579, 2.81800391389432, 2.85714285714286, 2.89628180039139,      2.93542074363992, 2.97455968688845, 3.01369863013699, 3.05283757338552,      3.09197651663405, 3.13111545988258, 3.17025440313112, 3.20939334637965,      3.24853228962818, 3.28767123287671, 3.32681017612524, 3.36594911937378,      3.40508806262231, 3.44422700587084, 3.48336594911937, 3.52250489236791,      3.56164383561644, 3.60078277886497, 3.6399217221135, 3.67906066536204,      3.71819960861057, 3.7573385518591, 3.79647749510763, 3.83561643835616,      3.8747553816047, 3.91389432485323, 3.95303326810176, 3.99217221135029,      4.03131115459883, 4.07045009784736, 4.10958904109589, 4.14872798434442,      4.18786692759295, 4.22700587084149, 4.26614481409002, 4.30528375733855,      4.34442270058708, 4.38356164383562, 4.42270058708415, 4.46183953033268,      4.50097847358121, 4.54011741682975, 4.57925636007828, 4.61839530332681,      4.65753424657534, 4.69667318982387, 4.73581213307241, 4.77495107632094,      4.81409001956947, 4.853228962818, 4.89236790606654, 4.93150684931507,      4.9706457925636, 5.00978473581213, 5.04892367906066, 5.0880626223092,      5.12720156555773, 5.16634050880626, 5.20547945205479, 5.24461839530333,      5.28375733855186, 5.32289628180039, 5.36203522504892, 5.40117416829746,      5.44031311154599, 5.47945205479452, 5.51859099804305, 5.55772994129159,      5.59686888454012, 5.63600782778865, 5.67514677103718, 5.71428571428571,      5.75342465753425, 5.79256360078278, 5.83170254403131, 5.87084148727984,      5.90998043052838, 5.94911937377691, 5.98825831702544, 6.02739726027397,      6.0665362035225, 6.10567514677104, 6.14481409001957, 6.1839530332681,      6.22309197651663, 6.26223091976517, 6.3013698630137, 6.34050880626223,      6.37964774951076, 6.4187866927593, 6.45792563600783, 6.49706457925636,      6.53620352250489, 6.57534246575342, 6.61448140900196, 6.65362035225049,      6.69275929549902, 6.73189823874755, 6.77103718199609, 6.81017612524462,      6.84931506849315, 6.88845401174168, 6.92759295499021, 6.96673189823875,      7.00587084148728, 7.04500978473581, 7.08414872798434, 7.12328767123288,      7.16242661448141, 7.20156555772994, 7.24070450097847, 7.27984344422701,      7.31898238747554, 7.35812133072407, 7.3972602739726, 7.43639921722114,      7.47553816046967, 7.5146771037182, 7.55381604696673, 7.59295499021526,      7.6320939334638, 7.67123287671233, 7.71037181996086, 7.74951076320939,      7.78864970645793, 7.82778864970646, 7.86692759295499, 7.90606653620352,      7.94520547945205, 7.98434442270059, 8.02348336594912, 8.06262230919765,      8.10176125244618, 8.14090019569472, 8.18003913894325, 8.21917808219178,      8.25831702544031, 8.29745596868884, 8.33659491193738, 8.37573385518591,      8.41487279843444, 8.45401174168297, 8.49315068493151, 8.53228962818004,      8.57142857142857, 8.6105675146771, 8.64970645792564, 8.68884540117417,      8.7279843444227, 8.76712328767123, 8.80626223091977, 8.8454011741683,      8.88454011741683, 8.92367906066536, 8.96281800391389, 9.00195694716243,      9.04109589041096, 9.08023483365949, 9.11937377690802, 9.15851272015655,      9.19765166340509, 9.23679060665362, 9.27592954990215, 9.31506849315068,      9.35420743639922, 9.39334637964775, 9.43248532289628, 9.47162426614481,      9.51076320939335, 9.54990215264188, 9.58904109589041, 9.62818003913894,      9.66731898238747, 9.70645792563601, 9.74559686888454, 9.78473581213307,      9.8238747553816, 9.86301369863014, 9.90215264187867, 9.9412915851272,      9.98043052837573, 10.0195694716243, 10.0587084148728, 10.0978473581213,      10.1369863013699, 10.1761252446184, 10.2152641878669, 10.2544031311155,      10.293542074364, 10.3326810176125, 10.3718199608611, 10.4109589041096,      10.4500978473581, 10.4892367906067, 10.5283757338552, 10.5675146771037,      10.6066536203522, 10.6457925636008, 10.6849315068493, 10.7240704500978,      10.7632093933464, 10.8023483365949, 10.8414872798434, 10.880626223092,      10.9197651663405, 10.958904109589, 10.9980430528376, 11.0371819960861,      11.0763209393346, 11.1154598825832, 11.1545988258317, 11.1937377690802,      11.2328767123288, 11.2720156555773, 11.3111545988258, 11.3502935420744,      11.3894324853229, 11.4285714285714, 11.46771037182, 11.5068493150685,      11.545988258317, 11.5851272015656, 11.6242661448141, 11.6634050880626,      11.7025440313112, 11.7416829745597, 11.7808219178082, 11.8199608610568,      11.8590998043053, 11.8982387475538, 11.9373776908023, 11.9765166340509,      12.0156555772994, 12.0547945205479, 12.0939334637965, 12.133072407045,      12.1722113502935, 12.2113502935421, 12.2504892367906, 12.2896281800391,      12.3287671232877, 12.3679060665362, 12.4070450097847, 12.4461839530333,      12.4853228962818, 12.5244618395303, 12.5636007827789, 12.6027397260274,      12.6418786692759, 12.6810176125245, 12.720156555773, 12.7592954990215,      12.7984344422701, 12.8375733855186, 12.8767123287671, 12.9158512720157,      12.9549902152642, 12.9941291585127, 13.0332681017613, 13.0724070450098,      13.1115459882583, 13.1506849315068, 13.1898238747554, 13.2289628180039,      13.2681017612524, 13.307240704501, 13.3463796477495, 13.385518590998,      13.4246575342466, 13.4637964774951, 13.5029354207436, 13.5420743639922,      13.5812133072407, 13.6203522504892, 13.6594911937378, 13.6986301369863,      13.7377690802348, 13.7769080234834, 13.8160469667319, 13.8551859099804,      13.894324853229, 13.9334637964775, 13.972602739726, 14.0117416829746,      14.0508806262231, 14.0900195694716, 14.1291585127202, 14.1682974559687,      14.2074363992172, 14.2465753424658, 14.2857142857143, 14.3248532289628,      14.3639921722113, 14.4031311154599, 14.4422700587084, 14.4814090019569,      14.5205479452055, 14.559686888454, 14.5988258317025, 14.6379647749511,      14.6771037181996, 14.7162426614481, 14.7553816046967, 14.7945205479452,      14.8336594911937, 14.8727984344423, 14.9119373776908, 14.9510763209393,      14.9902152641879, 15.0293542074364, 15.0684931506849, 15.1076320939335,      15.146771037182, 15.1859099804305, 15.2250489236791, 15.2641878669276,      15.3033268101761, 15.3424657534247, 15.3816046966732, 15.4207436399217,      15.4598825831703, 15.4990215264188, 15.5381604696673, 15.5772994129159,      15.6164383561644, 15.6555772994129, 15.6947162426614, 15.73385518591,      15.7729941291585, 15.812133072407, 15.8512720156556, 15.8904109589041,      15.9295499021526, 15.9686888454012, 16.0078277886497, 16.0469667318982,      16.0861056751468, 16.1252446183953, 16.1643835616438, 16.2035225048924,      16.2426614481409, 16.2818003913894, 16.320939334638, 16.3600782778865,      16.399217221135, 16.4383561643836, 16.4774951076321, 16.5166340508806,      16.5557729941292, 16.5949119373777, 16.6340508806262, 16.6731898238748,      16.7123287671233, 16.7514677103718, 16.7906066536204, 16.8297455968689,      16.8688845401174, 16.9080234833659, 16.9471624266145, 16.986301369863,      17.0254403131115, 17.0645792563601, 17.1037181996086, 17.1428571428571,      17.1819960861057, 17.2211350293542, 17.2602739726027, 17.2994129158513,      17.3385518590998, 17.3776908023483, 17.4168297455969, 17.4559686888454,      17.4951076320939, 17.5342465753425, 17.573385518591, 17.6125244618395,      17.6516634050881, 17.6908023483366, 17.7299412915851, 17.7690802348337,      17.8082191780822, 17.8473581213307, 17.8864970645793, 17.9256360078278,      17.9647749510763, 18.0039138943249, 18.0430528375734, 18.0821917808219,      18.1213307240705, 18.160469667319, 18.1996086105675, 18.238747553816,      18.2778864970646, 18.3170254403131, 18.3561643835616, 18.3953033268102,      18.4344422700587, 18.4735812133072, 18.5127201565558, 18.5518590998043,      18.5909980430528, 18.6301369863014, 18.6692759295499, 18.7084148727984,      18.747553816047, 18.7866927592955, 18.825831702544, 18.8649706457926,      18.9041095890411, 18.9432485322896, 18.9823874755382, 19.0215264187867,      19.0606653620352, 19.0998043052838, 19.1389432485323, 19.1780821917808,      19.2172211350294, 19.2563600782779, 19.2954990215264, 19.3346379647749,      19.3737769080235, 19.412915851272, 19.4520547945205, 19.4911937377691,      19.5303326810176, 19.5694716242661, 19.6086105675147, 19.6477495107632,      19.6868884540117, 19.7260273972603, 19.7651663405088, 19.8043052837573,      19.8434442270059, 19.8825831702544, 19.9217221135029, 19.9608610567515,      20), y = c(0.0217667400980039, 0.0227118960613568, 0.0236399642746827,      0.024547462294379, 0.0254284817500052, 0.0262697990497476, 0.0270761925341352,      0.0278447201687443, 0.0285725349842736, 0.0292431898522125, 0.0298599237216537,      0.0304262344415342, 0.0309405476728982, 0.0313967502030459, 0.0317805594200756,      0.0321087524689367, 0.0323813637754389, 0.0325985887432935, 0.0327456085503099,      0.0328338748111955, 0.032871094252979, 0.032858917719392, 0.0327952170079012,      0.0326741710852976, 0.0325130172841641, 0.0323142824586605, 0.0320805363813515,      0.0318066450090944, 0.0315032349150802, 0.0311762923391493, 0.0308283666713486,      0.0304606397730375, 0.0300742685852501, 0.0296767520098838, 0.0292699115474762,      0.0288554692880644, 0.0284340054317109, 0.0280086390955194, 0.0275806684358679,      0.0271507171781247, 0.0267191796498216, 0.0262860885684517, 0.0258516152315375,      0.025415436557538, 0.0249771598811644, 0.0245350861062508, 0.0240885560431356,      0.023637102870035, 0.023179973519991, 0.0227156094045636, 0.022241184162465,      0.0217581061784532, 0.0212659006410898, 0.0207641513896269, 0.020249460771043,      0.0197238756753159, 0.0191886405031699, 0.0186441419420248, 0.0180900824959544,      0.0175265997231419, 0.0169574756929679, 0.0163840336778012, 0.0158076842167135,      0.0152307532198712, 0.0146567117250279, 0.0140876768708212, 0.0135257717396179,      0.0129746875992836, 0.0124411735382691, 0.0119248408581489, 0.0114281180660412,      0.0109534391260541, 0.0105125675916208, 0.0101040127121235, 0.0097278039838056,      0.00938617839440894, 0.00908600262449913, 0.00883795563273938,      0.00863315495962393, 0.00847325872834633, 0.00835985054125376,      0.0083104707966061, 0.00831574579983596, 0.00837242006745159,      0.0084811812661746, 0.00864895114585229, 0.0088847277032945,      0.0091733846139949, 0.00951451815849311, 0.00990760864554539,      0.0103676944983387, 0.0108803185070754, 0.0114398691731338, 0.0120446169019066,      0.0126975354786556, 0.0134003348410125, 0.014138322350119, 0.0149085888122459,      0.0157081161739461, 0.0165397010226779, 0.0173908415086893, 0.0182558660392905,      0.0191308446396648, 0.0200115146141704, 0.0208896684310384, 0.0217595621107009,      0.0226168398271489, 0.0234571367239625, 0.0242658576551506, 0.0250415384796808,      0.025781743996249, 0.0264824465880188, 0.0271330271813973, 0.0277197602228349,      0.0282514207578494, 0.0287250463560853, 0.0291378145433322, 0.0294643336036007,      0.0297185497373367, 0.0299034233614394, 0.0300178272409036, 0.0300510165057044,      0.0299933390096322, 0.029864296171915, 0.0296646737354628, 0.0293954446422498,      0.02903609387537, 0.0286087954739586, 0.0281202389214091, 0.0275730852809592,      0.0269631864592354, 0.0262908755920268, 0.025574205859082, 0.0248169722677519,      0.024023046736675, 0.0231883685262104, 0.0223289370148913, 0.0214507109581384,      0.0205578894465608, 0.0196543161993343, 0.0187475783069642, 0.0178440120329414,      0.0169474708137715, 0.0160617456778675, 0.0151982413151739, 0.0143579764501946,      0.0135431035900457, 0.0127565541603801, 0.0120065112945572, 0.0113013352426194,      0.010635019980095, 0.0100094469431421, 0.00942639127892244, 0.0089039890191574,      0.00843070966487366, 0.00800519340240519, 0.00762818830262024,      0.00730797543721608, 0.00704980283664362, 0.00684141502281347,      0.00668265968608497, 0.00657330236985191, 0.00652994734551145,      0.00653626373538692, 0.00658916348197513, 0.00668767640137901,      0.00683740677506747, 0.00703949814277543, 0.00728169259995597,      0.00756244741730784, 0.00788017305139687, 0.00824447686134098,      0.00864128336177512, 0.00906733428314206, 0.00952075397149063,      0.0100031836945359, 0.010512665615019, 0.0110414546541446, 0.0115878311927959,      0.0121501195536992, 0.0127308183673382, 0.01332332344487, 0.0139262209784856,      0.0145387177488175, 0.015161575268352, 0.0157951749967284, 0.016438040193859,      0.0170909905985346, 0.0177550383014629, 0.0184378178562425, 0.019138615981402,      0.0198599761627206, 0.0206051085684539, 0.0213835326226107, 0.0222057991861808,      0.0230705544613072, 0.0239831651499172, 0.0249491866774483, 0.0260019858815712,      0.0271307566962957, 0.0283404432091247, 0.0296377725554787, 0.0310483777483443,      0.0325909750094088, 0.0342501536507845, 0.0360320721161026, 0.0379427304435736,      0.0400427505040893, 0.0422911469270196, 0.0446880555428848, 0.0472364098981542,      0.0499665903504324, 0.0528865496293085, 0.0559605500295509, 0.0591864336230866,      0.0625614652392627, 0.0661323901936574, 0.0698369942423732, 0.0736642649820459,      0.0776053170213216, 0.0816654985557755, 0.0858243890440125, 0.0900462454820139,      0.0943168565446659, 0.0986215759610166, 0.102937806780721, 0.107234576343045,      0.111494854705369, 0.115701725627134, 0.119818728151249, 0.123810263483841,      0.127676838260079, 0.131403340542788, 0.134975040188428, 0.138301149786118,      0.141429558148372, 0.144353043040705, 0.147063324586097, 0.149509011012514,      0.151678338013187, 0.153617609445566, 0.155327745461799, 0.156810642833852,      0.157987822962458, 0.15895731472489, 0.159731001895812, 0.160320192816835,      0.16070927729284, 0.160927335641176, 0.161026262422779, 0.161024035352265,      0.160939101818898, 0.160783676919756, 0.160610951636628, 0.160440813332408,      0.160292840283904, 0.160202196337883, 0.160205045445256, 0.160307691092289,      0.160525158759831, 0.160872099587403, 0.161427322298974, 0.162146341126922,      0.16303494787568, 0.1640978213177, 0.165374536988198, 0.166861439709314,      0.168517967752217, 0.170337253164731, 0.172312150290867, 0.174476220294316,      0.17675201562322, 0.17912237546253, 0.181569351447975, 0.184077063209181,      0.186601937519015, 0.189110996532675, 0.19158078566652, 0.193986444864657,      0.196248038237016, 0.198366671014338, 0.2003193238609, 0.202083414374645,      0.203583109911179, 0.204784727823111, 0.20571235693773, 0.206350205706743,      0.206678507619118, 0.206556713002678, 0.206095969055307, 0.205290936474901,      0.20413741111321, 0.202556572638439, 0.20056355298721, 0.198228613635869,      0.195558644146613, 0.192555647948946, 0.189126333152985, 0.185410492636506,      0.181423717899618, 0.177182210388674, 0.172658716028772, 0.167900183255391,      0.16296802586402, 0.157882368007903, 0.152661212543965, 0.147304635977954,      0.141882524743064, 0.136414358489409, 0.130919304274034, 0.125422474679471,      0.119957697079395, 0.11454052598248, 0.109185666974252, 0.103909993572189,      0.0987683404859644, 0.093741308688079, 0.0888376270971578, 0.0840654236882268,      0.0794666168513133, 0.0750427325158831, 0.0707727313029462, 0.0666591512693038,      0.0627091344513033, 0.0589774733641864, 0.0554044324211085, 0.0519885093076509,      0.0487279204345587, 0.0456550213639223, 0.0427535393057037, 0.0399945562439461,      0.0373743649778989, 0.0348937863392637, 0.0325878723180957, 0.0304033659564744,      0.0283361981437062, 0.0263823330082348, 0.0245619867105529, 0.0228595658836749,      0.0212541351296348, 0.0197423154392725, 0.0183242669772017, 0.0170220160814398,      0.0158005734119126, 0.0146575124941681, 0.0135905002875402, 0.0126143097870055,      0.0117191044664318, 0.0108918081116421, 0.0101309359870987, 0.0094379000631823,      0.00883019944826195, 0.00828380391399826, 0.00779783511360308,      0.00737145971429946, 0.00701812393006059, 0.0067311252542151,      0.00650097052493056, 0.00632717374230014, 0.00621198669319391,      0.00617143557767508, 0.0061855594050197, 0.00625405591658972,      0.00637663424018689, 0.00656643085439909, 0.00681747969859399,      0.00712155184640286, 0.00747843433306984, 0.0078907086989986,      0.00837340291572697, 0.00890806427672648, 0.009494513737272,      0.010132574128414, 0.010835143782014, 0.0115961949265227, 0.0124081127363209,      0.0132707231223347, 0.0141867435373067, 0.0151701717571193, 0.0162034512423126,      0.0172863373562776, 0.0184185690183941, 0.019612438019485, 0.0208613703536178,      0.0221579723104729, 0.0235016744919049, 0.0248946535533411, 0.0263479485897112,      0.0278446638511839, 0.0293835133691365, 0.0309631084740302, 0.0325912348690895,      0.0342591472113346, 0.0359590659180276, 0.0376882779600787, 0.0394452615206507,      0.0412293518464991, 0.043027543361404, 0.0448353514472685, 0.0466481043572906,      0.0484577337141087, 0.0502538712990142, 0.0520305447610213, 0.0537813149370389,      0.0554964047538021, 0.0571515262745735, 0.0587502027060215, 0.0602849490847391,      0.0617482500354599, 0.0631066082295335, 0.0643579690671984, 0.0655057363703737,      0.0665429490020974, 0.0674531640036809, 0.0681929810868339, 0.0687958988058021,      0.0692572514303207, 0.0695726946039624, 0.069695167044965, 0.0696433847901905,      0.0694350823030356, 0.0690697581056959, 0.068535116834938, 0.0677961078509799,      0.0669066143489608, 0.0658704054221769, 0.0646916508125923, 0.0633398550663818,      0.0618485040466386, 0.0602410483121883, 0.0585250659382392, 0.0567013372657685,      0.0547654519871085, 0.0527582945347469, 0.0506891518402187, 0.0485673654999008,      0.0463957642449994, 0.0441983057887947, 0.0419884488508511, 0.0397750260303709,      0.0375684836047041, 0.0353879440268247, 0.0332384672584751, 0.0311267921300081,      0.0290593901126105, 0.0270601872571371, 0.0251287992452735, 0.0232632081303122,      0.0214669543868477, 0.0197503127220639, 0.0181339971366657, 0.0165964380609598,      0.0151383742283497, 0.013760299683845, 0.012485591080821, 0.0112979221667829,      0.0101874296294859, 0.00915261833812058, 0.00819857079937494,      0.00733611052320258, 0.00654025398573884, 0.00580844808959148,      0.0051380838601794, 0.00454221827421074, 0.00400446040436533,      0.00351615254678973, 0.0030745243393893, 0.00268072850148871,      0.00233768602660161, 0.00202984861125548, 0.00175479227131742,      0.00151014383233181, 0.00130072566668639, 0.00111721604283242,      0.000955112980316734, 0.000812623159815952, 0.000689590092917738,      0.0005860912862362, 0.000495639552545513, 0.000417014922709681,      0.000349049284657548, 0.000292958836410902, 0.00024515801710463,      0.000204040052154968, 0.000168884867932852, 0.000139474416390484,      0.000115548025328669, 9.51646202245106e-05, 7.79159203801693e-05,      6.34177645960676e-05, 5.18748729574288e-05, 4.22967579760247e-05,      3.42684953287067e-05, 2.75891372479148e-05, 2.21737075433437e-05,      1.79085413159829e-05, 1.43641470627961e-05, 1.14430817192601e-05,      9.05508126397165e-06, 7.22026287729582e-06, 5.73639534240461e-06,      4.52392445545382e-06, 3.54207412160509e-06, 2.77052765004019e-06,      2.18172878629954e-06, 1.7042057736597e-06, 1.32082991902191e-06,      1.01596818604684e-06, 7.89867561242482e-07, 6.11506981747829e-07,      4.69391759719292e-07, 3.57363517027134e-07), bw = 0.715374250961732,          n = 35L, call = density.default(x = dat.prior, from = 0,              to = 20), data.name = "dat.prior", has.na = FALSE), .Names = c("x",      "y", "bw", "n", "call", "data.name", "has.na"), class = "density")


title: What is the probability that this person is female?

text: There is a person behind a curtain - I do not know whether the person is female or male. I know the person has long hair, and that 90% of all people with long hair are female I know the person has a rare blood type AX3, and that 80% of all people with this blood type are female. What is the probability the person is female? NOTE: this original formulation has been expanded with two further assumptions: 1\. Blood type and hair length are independent 2\. The ratio male:female in the population at large is 50:50 (The specific scenario here is not so relevant - rather, I have an urgent project that requires I get my mind around the correct approach for answering this. My gut feel is that it's a question of simple probability, with a simple definitive answer, rather than something with multiple debatable answers according to different statistical theories.)


title: Diagnostic plot for assessing homogeneity of variance-covariance matrices

text: Is there a handy plot for comparing the variance-covariance matrices of two (or perhaps more) groups? An alternative to looking at lots of marginal plots, especially in the multivariate Normal case?


title: How can I estimate model predicted means (a.k.a. marginal means, lsmeans, or EM means) from a GEE model fitted in R?

text: I am trying to obtain model-predicted means and CI's for a categorical predictor in a GEE model fitted with the geeglm function (geepack package). The model is fitted with no problem, but where I am stuck is when trying to estimate the model-predicted group means. This is something fairly easy to do in other software packages (i.e., SAS and SPSS), but my point is to try to do this in R (also I was a bit disappointed to find no direct way to obtain overall tests for a categorical predictor other than fitting reduced and full models separately and then comparing them; but on the other hand I was able to find an easy way to compute the QIC with the MESS package). Anyway, I searched around to see if perhaps this was done with another package (there's a package called lsmeans, but it seems not compatible with geepack or gee packages). I am surprised I have not been able to find something as common as estimating model predicted means for a GEE model in R, so I was wondering if someone knows a solution for this. I tried contacting the geepack maintainer, but no answer. Why GEE instead of a mixed model (marginal means for a mixed model can be computed using the lmerTest package)? well, it has fewer assumptions, and is more robust with small samples.


title: R linear model summaries, why is one model "better" than the other?

text: I am attempting to get my head around the summaries of linear models given within R. In other words i am trying to identify when the summary of a model is good or bad. Consider the following two examples, they are both derived from the same data except the latter has been simplified using step(). Why is the latter better than the first? Example one:               Residuals:         Min      1Q  Median      3Q     Max      -37.679 -11.893  -2.567   7.410  62.190           Coefficients:                   Estimate Std. Error t value Pr(>|t|)        (Intercept)  42.942055  24.010879   1.788  0.07537 .      seasonspring  3.726978   4.137741   0.901  0.36892        seasonsummer  0.747597   4.020711   0.186  0.85270        seasonwinter  3.692955   3.865391   0.955  0.34065        sizemedium    3.263728   3.802051   0.858  0.39179        sizesmall     9.682140   4.179971   2.316  0.02166 *      speedlow      3.922084   4.706315   0.833  0.40573        speedmedium   0.246764   3.241874   0.076  0.93941        mxPH         -3.589118   2.703528  -1.328  0.18598        mnO2          1.052636   0.705018   1.493  0.13715        Cl           -0.040172   0.033661  -1.193  0.23426        NO3          -1.511235   0.551339  -2.741  0.00674 **     NH4           0.001634   0.001003   1.628  0.10516        oPO4         -0.005435   0.039884  -0.136  0.89177        PO4          -0.052241   0.030755  -1.699  0.09109 .      Chla         -0.088022   0.079998  -1.100  0.27265        ---     Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1          Residual standard error: 17.65 on 182 degrees of freedom     Multiple R-squared:  0.3731,    Adjusted R-squared:  0.3215      F-statistic: 7.223 on 15 and 182 DF,  p-value: 2.444e-12      Example Two:               Call:     lm(formula = a1 ~ size + mxPH + Cl + NO3 + PO4, data = clean.algae[,          1:12])          Residuals:         Min      1Q  Median      3Q     Max      -28.874 -12.732  -3.741   8.424  62.926           Coefficients:                 Estimate Std. Error t value Pr(>|t|)         (Intercept) 57.28555   20.96132   2.733  0.00687 **      sizemedium   2.80050    3.40190   0.823  0.41141         sizesmall   10.40636    3.82243   2.722  0.00708 **      mxPH        -3.97076    2.48204  -1.600  0.11130         Cl          -0.05227    0.03165  -1.651  0.10028         NO3         -0.89529    0.35148  -2.547  0.01165 *       PO4         -0.05911    0.01117  -5.291 3.32e-07 ***     ---     Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1          Residual standard error: 17.5 on 191 degrees of freedom     Multiple R-squared:  0.3527,    Adjusted R-squared:  0.3324      F-statistic: 17.35 on 6 and 191 DF,  p-value: 5.554e-16


title: In a mixed two-way ANOVA, why does a Groups x Intervals interaction decompose under SSwithin and not SSbetween?

text: Say I've got three treatment groups, and I measure them at three time points. Since the interaction in question involves both the groups (which occur between subjects) and the time points (which occur within subjects), why should the Groups x Intervals interaction be decomposed under SSwithin and not SSbetween?


title: Sampling from a database

text: I am conducting a research study about breastfeedding. I receive a whole database of subjects which are suitable to my research. I have had to call each individual to ask for their approval to participate in the study since it also requieres the participation of their bosses and one co-worker. This means that I can only conduct research on individuals which boss and co-worker are willing to participate. I have receive several notifications of individuals who can not participate due to several reasons. From this standpoint my list of potential participants have been reduced. Is this type of sampling valid from a statistical perspective? My sample will be composed of approximately 30 individuals.


title: Comparing results for computer and pen and paper writing

text: I am conducting a study to examine the differences between writing paragraphs in English among junior high school students in Japan. We collected writing samples from four classes, approximately 38 students per class, and looked at the number of words written, the number of grammar errors, and the number of spelling errors. The students wrote five paragraphs over the semester, with two classes writing three computer paragraphs and two paper and pen paragraphs while the other two classes wrote two computer paragraphs and three paper and pen paragraphs. We assumed that students would write more and make fewer errors using a computer because of the spell and grammar checker. We will calculate descriptive statistics, but I am wondering how we can show if there is a difference between the computer and paper paragraphs. I am thinking that we will use a t-test for independent samples comparing the means of all computer writings with all paper writings. Is this correct? I have only used a t-test with two distinct groups (male and female) but in this case it is the the difference between two activities. Any help would be appreciated. I am a real novice to statistics. Thanks


title: How do I interpret high residuals for the reproduced correlations in factor analysis?

text: I am doing a principal components analysis on a 4 item psychological scale (response format is a 0-10 point Likert scale for each item). As I hoped, an exploratory factor analysis yielded one factor. The result are looking good, one factor explains 83% of variance, the correlation coefficients are high but not too high (0.7-0.8), the KMO and Bartlett's tests are all fine. My problem is that 4 residuals (66%) of the reproduced correlations are over an absolute value of 0.05. I know this is a problem, but am trying to establish how much of problem this is to the model. Also what (if anything) can be done to fix it? Any answers or advice on where to find answers would be appreciated.


title: Distribution of variable for discriminant function analysis

text: I have a variable, in which many of the scores are zero (it is a geographical remoteness scale where metropolitan = 0). What sort of transformation should I do on this data, so I don't violate normality assumptions for performing a DFA? thanks DC


title: Ignore assumptions and still go ahead with a parametric test?

text: I have data which is not normally distrubuted (histogram doesnt show a bellshape data and normal plot shows a bit of a zig zag data going through line of best fit) but standard deviations are of similar size. As a result, i cannot use repeated measures ANOVA since data didnt meet one of the assumptions. Now, the nonparametric of repeated measures of ANOVA is the Friedman test, however, im using stata and this statistical package does not have this test in the programme. I wanted to get your opinion on if it would be okay to use repeated measures ANOVA even though data is non-parametric or would this really give me false results? Looking forward to hearing your opiniona. Thanks


title: should I include random effects in a model if they aren't statistically significant?

text: should I include random effects in a model even if they aren't statistically significant? I have a repeated measures experimental design, in which each individual experiences three different treatments in random order. I would like to control for any effects of individual and order, but neither seem to be statistically significant in my models. Does that make it OK to exclude them, or should I still include them?


title: The use of Elo for multi-game matches

text: In the popular computer game "Dota 2", professional teams play matches against one another. Sometimes these matches are best of one, sometimes they are best of two, sometimes best of three, etc, etc. I've created an Elo model, considering each of these professional teams as a single entity, and considering each individual _game_ (whether or not it forms part of a series) as a data point for Elo updates. My question is whether this is the right thing to do, and if not what to do to fix the issue. My concern with the alternative (considering a series of games as a single Elo entity with a single result) is that it would not differentiate between a series that went 7-0 and one that went 7-6, whereas there is clearly a difference. Also, this would require some weighting algorithm for best of matches, which to me seems like rather just weighting the individual matches (winning a best-of-101 51-0 shouldn't net you the same points as winning 51-49). I would assume that being able to predict based off of games also makes sense, in that as a predictive model it allows huge flexibility in being able to predict winners (and expected win % for teams) in series of arbitrary sizes. For example, if you knew the expected value of team A beating team B in a single game, you could calculate more complex stuff like 'chance of team A winning 3-0', 'chance of team A losing the first game but then winning three in a row', etc.


title: Is it random and representative of all Australians if 200 people are interviewed from the the Sydney area Phone book?

text: 1000 people selected, 200 replies those were taken in as data. Is this representative of Australian even though it's just in the sydney area. Is it random?


title: Standardizing data in Principal Component Analysis?

text: Since PCA is sensitive to scaling, I am thinking of standardizing each explanatory variable to have mean 0 and standard deviation 1. What are the drawbacks of such a standardization? Thank you.


title: What is a "sampling distance"?

text: In paper: > A. Vlad, A. Luca, and M. Frunzete, " _Computational measurements of the > transient time and of the sampling distance that enables statistical > independence in the logistic map_ ," in Proc. Int. Conf. Computational > Science and its applications, Berlin, 2009, pp. 703-718 it is mentioned that for a time series $X = \\{x_k,x_{k+1},\ldots,x_{k+n},\ldots\\}$, $x_n$ and $x_{k+d}$ are statistically independent when $d \rightarrow \infty$ where $d$ is an integer denoting the sampling distance. Let's say $d = 5$, then for a time series that is generated by $x_{k+1} = Rx_k(1-x_k) \tag{1}$ where the the parameter $R$ enables chaotic behavior. The distribution is not Gaussian and the Authors performed Kolmogorov-Smirnov test based for showing statistical independence. Quote : pg: 705 > This test method is here required because the investigated random variables > are not normally distributed, they are even of unknown statistical law. For > each and every investigated R value we used Smirnov tests to verify if two > experimental data sets are coming out from the same probability law or not. EDIT: Sampling distance as defined in paper > Vlad, Adriana, Adrian Luca, and Madalin Frunzete. "Computational > measurements of the transient time and of the sampling distance that enables > statistical independence in the logistic map." Computational Science and Its > Applications–ICCSA 2009. Springer Berlin Heidelberg, 2009. 703-718. > > " The two random variables $X$ and $Y$ submitted to the statistical test are > sampled from the random process assigned to (1) at two iterations $k_1$ and > $k_1 + d$. We attempted to measure the minimum sampling distance $d$ which > enables the statistical independence between $X$ and $Y$. We wanted to > establish which is the minimum $d$ sampling distance which enables to accept > that two random variables, $X$ and $Y$ extracted from the random process (1) > at iterations are statistically independent. Our measurements bring into > evidence that the minimum $d$ statistical independence distance is affected > by $R$ parameter. The overall experimental study performed on all mentioned > values of $R$ parameter (4; 3.9999; 3.999; 3.99; 3.95; 3.9; 3.8; 3.78) > indicates that d minimum sampling distance is about: 15 iterations for R = > 4; 20 iterations for R =3.9999 and R = 3.999; 30 iterations for R =3.99 > (etc). The statistical independence distance is important in practice mainly > for the stationarity region of the chaotic map, so that the quantitative > results are not dependent on the initial distribution law of the chaotic > process. Referring to the overall results, we can say that for initial > conditions $x_0$ (for generating the random process in (1)) is uniformly > distributed in (0,1) interval, a value of about 40-50 iterations is quite > enough to ensure both the transient time (the time interval elapsed from an > initial condition of the chaotic signal up to its entrance in stationarity) > and the minimum statistical independence sampling distance for all R > investigated values." In Paper: `Yu, Lei, et al. "Compressive sensing with chaotic sequence." Signal Processing Letters, IEEE 17.8 (2010): 731-734.` download link, under Section C and Remark 2.2: it is mentioned that the output of (1) is not independent but its independence can be measured through higher order correlations which is determined by the sampling distance. If the sampling distance is chosen large enough, for distance $d$ = 15, then for any positive integer $m_0$, $m_1 < 2^d$, $X$ has $E(x_k^{m_0} x_{k+d}^{m_1}) = E(x_k^{m_0}) E(x_{k+d}^{m_1})$ Based on this, I have the following question: Q1: Can somebody please show with an example time series vector what is meant by sampling distance? Will a sampling distance of say $d = 5$ mean that the resulting sampled time series, say $Z$ will have data points taken after every 5 samples? For example, if $X$ is represented as $X = \\{x_n,x_{n+1},\ldots,x_{n+k},\ldots\\}$ and $Z = \\{z_n,z_{n+d},\ldots,z_{n+kd}\\}$. Let's say that from equation 1 $$X = [x_1,\, x_2,\, x_3,\, x_4,\, x_5,\, x_6,\, x_7,\, x_8,\, x_9,\, x_{10},\, x_{11},\, x_{12},\, x_{13},\, x_{14},\, x_{15},\, x_{16},\, x_{17},\, x_{18},\, x_{19},\, x_{20}]$$ then will $Z$ be: $$Z = [x_6,\, x_7,\, x_8,\, x_9,\, x_{10},\, x_{16},\, x_{17},\, x_{18},\, x_{19},\, x_{20}]$$


title: Why are eigen and svd decompositions of a covariance matrix based on sparse data yielding different results?

text: I am trying to decompose a covariance matrix based on a sparse / gappy data set. I'm noticing that the sum of lambda (explained variance), as calculated with `svd`, is being amplified with increasingly gappy data. Without gaps, `svd` and `eigen` yeild the same results. This does not seem to happen with an `eigen` decomposition. I had been leaning towards using `svd` because the lambda values are always positive, but this tendency is worrying. Is there some sort of correction that needs to be applied, or should I avoid `svd` altogether for such a problem.               ###Make complete and gappy data set     set.seed(1)     x <- 1:100     y <- 1:100     grd <- expand.grid(x=x, y=y)          #complete data     z <- matrix(runif(dim(grd)[1]), length(x), length(y))     image(x,y,z, col=rainbow(100))          #gappy data     zg <- replace(z, sample(seq(z), length(z)*0.5), NaN)     image(x,y,zg, col=rainbow(100))               ###Covariance matrix decomposition     #complete data     C <- cov(z, use="pair")     E <- eigen(C)     S <- svd(C)          sum(E$values)         sum(S$d)     sum(diag(C))               #gappy data (50%)     Cg <- cov(zg, use="pair")     Eg <- eigen(Cg)     Sg <- svd(Cg)          sum(Eg$values)         sum(Sg$d)     sum(diag(Cg))                    ###Illustration of amplification of Lambda     set.seed(1)     frac <- seq(0,0.5,0.1)     E.lambda <- list()     S.lambda <- list()     for(i in seq(frac)){         zi <- z         NA.pos <- sample(seq(z), length(z)*frac[i])         if(length(NA.pos) > 0){             zi <- replace(z, NA.pos, NaN)         }         Ci <- cov(zi, use="pair")         E.lambda[[i]] <- eigen(Ci)$values          S.lambda[[i]] <- svd(Ci)$d     }               x11(width=10, height=5)     par(mfcol=c(1,2))     YLIM <- range(c(sapply(E.lambda, range), sapply(S.lambda, range)))          #eigen     for(i in seq(E.lambda)){         if(i == 1) plot(E.lambda[[i]], t="n", ylim=YLIM, ylab="lambda", xlab="", main="Eigen Decomposition")         lines(E.lambda[[i]], col=i, lty=1)     }     abline(h=0, col=8, lty=2)     legend("topright", legend=frac, lty=1, col=1:length(frac), title="fraction gaps")              #svd     for(i in seq(S.lambda)){         if(i == 1) plot(S.lambda[[i]], t="n", ylim=YLIM, ylab="lambda", xlab="", main="Singular Value Decomposition")         lines(S.lambda[[i]], col=i, lty=1)     }     abline(h=0, col=8, lty=2)     legend("topright", legend=frac, lty=1, col=1:length(frac), title="fraction gaps")      ![enter image description here](http://i.stack.imgur.com/SKHkb.png)


title: log-likelihood for a beta-binomial in R

text: Although I may ask a question that is already solved (but I found none that would explicitly refer to this), I would like to know, if (and I am no statistician) I am right with programming the log-likelihood function of a beta-binomial distribution in R as follows:               sum(lgamma(theta) - lgamma(Pi * theta) - lgamma((1 - Pi) * theta) + lgamma(n + 1) -     lgamma(Y + 1) - lgamma((n - Y) + 1) + lgamma(Y + Pi * theta) +     lgamma(n - Y + (1 - Pi) * theta) - lgamma(n + theta))      Here, theta is used as an overdispersion parameter. n is the number of trials, Y are the actual successes (from the real data), and Pi is the probability of success as derived from my model in JAGS. I (naively) took the density function as stated in Bolker (2008) and tried to take the logarithm of it. After that, I used this to compute an AIC and it gave reasonable numbers, but I am not sure! Thank you for your help! P.S. I know there are caveats about using AIC, especially in a bayesian context, but I just want to know if I am right in the way to derive the answer to this, although trying it may be foolish from a philosophical point of view in the first place...


title: Kolmogorov-Smirnov for Pareto distribution on sample

text: I want to use the _Kolmogorov-Smirnov test_ to test if a sample is drawn from a _Pareto distribution_. Unfortunately, the only way to estimate the distribution's parameters is from the sample. Does anybody know of the existence of tables with modified critical values or any other way to perform the test in this case?


title: How to test if the change in difference between 2 distributions is significant?

text: I have 2 different conditions of 'behaviour state' and 2 different people. I'm trying to find a way to test if the difference in distributions (which I'm assuming are approximately normal) changes significantly between these conditions, and cannot for the life of me figure out how to do this (particularly in MATLAB). Each person has a different number of observations, so I can't simply act as if they were matched pairs and subtract. Or in other words, if the difference $\Delta_1$ between people $X_1$ and $Y_1$ differs significantly between the difference $\Delta_2$ between people $X_2$ and $Y_2$.


title: Polynomial regression rules

text: With OLS regression the errors must be normally distributed and be homoscedastic. Does these rules apply to polynomial regression as well?


title: Case-crossover method with conditional logistic regression for poisson model generated data

text: I would like to run a semi-symmetric bi-directional case-crossover method on some generated data using conditional logistic regression. I generated data from Poisson distribution Poiss(lambda) with $\textrm{log}(\lambda)=\lambda_0 \textrm{exp}(x\beta), $ where $\lambda_0$ and $\beta$ are known and $x$ is a known time series. Then for each timepoint I split generated value into pairs: case in this timepoint and control in referent period (that is if in generated data there are $5$ cases at day $11$, I get $10$ observations for this timepoint: $5$ $(1$, $x$ at day $11)$ and $5 (0$, $x$ at reference period for day $11)$). Now I run conditional logistic regression on this data, with separate stratum for each pair. The question is, should the parameter estimates that I get from CLR be $\beta$ from parametrer of Poisson distribution? I found few articles with this procedure applied, but I can't figure out why estimetes from CLR and $\beta$ from Poisson distribution should be the same. Reference articles:   * T.Bateson, J.Shwartz, Control for Seasonal Variation and Time Trend in Case-Crossover Studies of Acute Effects of Environmental Exposures, Epidemiology 1999, 10(4), 539-544;   * S.Wang, B.Coukk, J.Shwartz, M.Mittleman, G.Wellenius, Potential for Bas in Case-Crossover Studies With Shared Exposures Analyzed Using SAS, American Journal of Epidemiology 2011, 174(1), 118-124;   * K.Fung, D.Krewski, Y.Chen, R.Burnett, S.Cakmak, Comparison of time-series and case-crossover analyses of air pollution and hospital admission data, International Journal of Epidemiology 2003, 32, 1064-1070; Thanks for help


title: If you perform an ARMA on the volatility and add the squared returns as external variable, do you obtain a GARCH?

text: I wanted to focus on volatility forecasting, so instead of asking R to compute a GARCH where it would compute the errors on the returns, I wanted to model the volatility as an ARMA and add an external regressor using the argument xreg in the arima function. I have two questions:   * Is it exactly equivalent to compute an ARMA(p,q) on the volatility with external regressors as the squared returns and to compute a GARCH (for the volatility forecast)   * Is it the correct way to do it in R ? Tony


title: Designing and validating a Likert-type scale with odd or even response categories

text: As part of an advisory team in my educational institution for undergraduate nurses, I (among others) have been assigned to design a questionnaire that will assess students' and academic staff's perceptions about the ability of the final year's exams as an adequate tool for evaluating students': knowledge-understanding /competence-skills/ and judgment-approach (in other words, to judge whether they are ready to safely work in the real world). The final questionnaire comprises 21 questions regarding the above mentioned 3 basic concepts. I proposed the answers to be given on a 5-point balanced Likert-type scale (strongly disagree to strongly agree with a neutral midpoint). However, the rest of the team is in favour of using an unbalanced 4-point scale (disagree/agree a little/agree/strongly agree). **Question 1:** Which scale would be more appropriate? Also, I believe that this proposed tool needs to be validated and checked for reliability first before being administered to the target population, however, most of my colleagues disagree, since, the questions arise from the corresponding 21 statements of our national regulatory board, according to which:   1. "Nurses must demonstrate knowledge of planning of health care measures",   2. "Nurses must demonstrate the ability to draw care plans",   3. "Nurses must demonstrate the ability to apply their knowledge so as to deal with different situations" and so on. The majority of the team is in favour of converting these statutory statements into a questionnaire as follows: > I believe that the test: Q1 "demonstrated knowledge of planning of health > care measures", Q2 "demonstrated the ability to draw care plans" and so on up to question 21, without checking for validity and reliability first. **Question 2:** Shouldn't this tool be tested first for its reliability and validity (convergent, discriminant, criteria validity, factor analysis, etc)?


What's the optimal way to encode a 'month' feature? A single integer value or 12 binary values don't quite grasp the concept of modulo distance... Say I want to train an SVM for a certain task and believe that the time of the year might contribute some valuable information, how should I transform it into a feature? What's the general approach to encoding numerical values that sit on a ring rather than an axis when using linear classifiers?


title: Moderation using ANCOVA

text: I am performing a repeated measures ANCOVA with `Mood Scores` as the dependent variable, `Image Condition` as the independent variable, `BMI` as the covariate and `Time` as the random effect. And I would like to find out if `BMI` moderates the changes in pre and post `mood scores` in all three `image conditions`. Hence, I would be looking for a 3-way interaction effect (`Time` × `Condition` × `BMI`) for this moderation effect. However, I do not find any 3-way interaction effect, but a 2-way interaction effect (`BMI` × `Condition`) is found instead. Can anyone explain to me what this 2-way interaction effect implies? And is there any follow-up test that I need to do to clarify the 2-way interaction? Thank you so much!


title: Creating an index of quality from multiple variables to enable rank ordering

text: I have four numeric variables. All of them are measures of soil quality. Higher the variable, higher the quality. The range for all of them is different: Var1 from 1 to 10 Var2 from 1000 to 2000 Var3 from 150 to 300 Var4 from 0 to 5 I need to combine four variables into single soil quality score which will successfully rank order. My idea is very simple. Standardize all four variables, sum them up and whatever you get is the score which should rank-order. Do you see any problem with applying this approach. Is there any other (better) approach that you would recommend? Thanks **Edit:** Thanks guys. A lot of discussion went into "domain expertise"... Agriculture stuff... Whereas I expected more stats-talk. In terms of technique that I will be using... It will probably be simple z-score summation + logistic regression as an experiment. Because vast majority of samples has poor quality 90% I'm going to combine 3 quality categories into one and basically have binary problem (somequality vs no-quality). I kill two birds with one stone. I increase my sample in terms of event rate and I make a use of experts by getting them to clasify my samples. Expert classified samples will then be used to fit log-reg model to maximize level of concordance / discordance with the experts.... How does that sound to you?


title: Select the best point pair in the 2D grid

text: Suppose in the 2D space we have an array of points, and each point has a weighting factor, which is a float value ranging from 0 to 1. Each point also has a coordinate in the 2D grid. The following pseduo-codes show the property of the point:               class Point     {      public:         float weightingFactor_; // [0,1].         float x_;         float y_;          }      Now my question is: given an array of points, how can we select the best point pair? The criterion for best point pair is: (1) both points should have large weighting factors; (2) the two points should be as far as possible spatially based on the Euclidean distance. For the time being, my solution is for each point pair calculate the following criterion:               Point1.weightingFactor_*Point2.weightingFactor*Distance(Point1, Point2)      Among all the point pair, then select the pair whose criterion value is the largest. I am not sure whether this is the best solution. Any ideas? Thanks.


title: Multivariate Quadrant Probability

text: For bivariate zero-mean normal distribution $P(x_1,x_2)$, the quadrant probability is defined as $P(x_1>0,x_2>0)$ or $P(x_1<0,x_2<0)$ and according to http://mathworld.wolfram.com/BivariateNormalDistribution.html $P(x_1>0,x_2>0) = \frac{1}{4}+\frac{sin^{-1}(\rho)}{2\pi}$, where $\rho \equiv corr(x_1,x_2)$ Is there an analytical solution for higher dimensional hyperquadrant probabilities? For instance, for $X\sim N(0_{N\times 1},\Sigma_{N\times N})$, the hyperquadrant probability is defined as $P(X>0)=P(x_1>0,x_2>0,...,x_N>0)$


title: competitive mediation explanation

text: I did a simple mediation analysis using PROCESS (attached). The result is all significant however the path "b" or M -> Y is negative. I've read somewhere, Zhao et al., that this is called "competitive mediation?", BUT i do not know how to explain or interpret the result. Can anybody explain this? Thank you. ![enter image description here](http://i.stack.imgur.com/EHffr.jpg) ![enter image description here](http://i.stack.imgur.com/GCWVH.jpg) ![enter image description here](http://i.stack.imgur.com/yfnGc.jpg)


title: Robust standardization of data

text: I have some data where I want to determine whether the shape of the probability distribution has changed compared to 10 years ago. One example is that I have for various automobiles multiple measures of price at a given point in time from different used car dealers and online sellers. make, model, year of manufacture, price (there are further complications such as condition etc, but I've simplified the problem somewhat). The data has a number of outliers. Is it possible to do a robust (to clarify, by robust I mean resistant to outliers) transformation that preserves the original distribution of values, but allows a comparison of probability distributions (with different means / sds) on a similar or identical scale such as [0,1]. Also, if I had an hypothesis such that maybe the distribution of prices had a different shape in the past. Is there any sensible way to combine the data from different makes and models so as to get a more accurate estimation of the shape of the distribution function, or is this completely nonsensical. I can of course individually compare the same make, model, yr of manufacture but I'm looking at a large number of comparisons. Thanks for any comments or suggestions.


title: Poisson probability question

text: For part a I think its just the poisson probability of 40 with rate = 48. I'm stuck on b to d. Cars pass checkpoint A in accordance with a Poisson process at an average rate of 24 cars per hour. All cars passing checkpoint A also pass checkpoint B which is located 10 miles down the road. The speed (MPH) of any individual car between A & B is constant and uniformly distributed on (40, 60). The speeds of all cars are mutually independent. Find: a) P(40 cars pass A between noon & 2PM) b) P(between 3 & 6PM, 20 cars pass A at a speed exceeding 55 MPH) c) P(10 cars pass B between noon & 1 PM) d) the probability that 5 cars pass B between 1 PM & 1:10PM, given that exactly 10 cars pass A between 12:30PM & 1 PM.


title: Clustering short time series

text: I would like to classify a relatively large set (over 9000) of short times series. The length of each sequence varies, but I would say about 80 % has between 2 and 9 observations. While I could use a simple trendline (maybe combined with a variance measure) to describe each these sequences, I would like to go a step beyond this solution. What other kinds of methods could I utilize to cluster the "visual appearance" of these sequences? The ultimate goal of the classification is to gain a understanding of what type of trend/style/behavior each sequence is exhibiting.


title: Support vector machine with IntelHD4000 GPU on Mac OS X Mavericks?

text: how can I use my GPU (Intel HD 4000) to speed up support vector machine (either using python, or matlab, or any other means) ? It seems Mavericks now includes OpenCL, but I would like to know if there is a library somewhere or if I need to code everything on my own... thanks !


title: SVM vs. artificial neural network

text: I have multiclass unbalanced data (4 class with 15% 25% 45% 15% data in each class). Which method is good for classification of such data- SVM or ANN? UPDATE- Let me make the question little more general. @Dikran Marsupial said in one answer "choice of classifier depends on the nature of the particular dataset" but what are the factors that one should consider before choosing a classifier. I understand the first chose may not give best answer all the time but it can be a good starting point. So what properties of data I should consider before choosing a classifier??


title: Interaction of categorical and continuous variable using GLM in SPSS

text: SPSS provides an easier option for dummy coding in the General Linear Model (GLM) function when compared to the regression menu. I am just wondering what should I do to perform hierarchical regression in GLM? Should I just choose Sum of Squares Type 1. My analysis involves one dependent variable, one categorical variable (factor) and one continuous predictor (covariate). I am interested in the main effect as well as any interaction. Many thanks in advance for any assistance. **EDIT** In response to the comment below, I propose to enter the following in the GLM window:   1. Enter the continuous DV   2. Enter the continuous IV as covariate   3. Enter the categorical IV as factor   4. Enter the product term (factor * covariate)   5. Select Sum of Squares 1 because of unequal sample size for the factor As stated above, my goal is to ascertain the main effect of the covariate on the DV, as well as the interaction between the covariate and factor on the DV.


title: Use of robust spread measures such median average deviation and median filters for time series

text: I have a time series where I need to detect gross anomalies due to coding errors, not small shifts in the structure of the series. I am interested in the most recent data points, not historical data so I don't need to filter everything. What is the best way to use moving means and averages in combination with spread estimators to find these points?


title: Help with SEM modeling (OpenMx, polycor)

text: I have lots of problem with one data set to which I am trying to apply SEM. We suppose the existence of 5 latent factors A, B, C, D, E, with indicators resp. A1 to A5 (ordered factors), B1 to B3 (quantitative), C1, D1, E1 (all last three ordered factors, with only 2 levels for E1. We are interested in covariances between all factors. I tried to use `OpenMx` to do so. Here are a few of my attempts:   * I first tried to use thresholds matrices for all the ordered factors, but the convergence failed.    * I decided to use polychoric/polyserial correlations instead of raw data, with the function `hetcor` from the library `polycor` (I planned to bootstrap the sample to get confidence intervals). It also fails to converge!   * I tried to restrict to individuals with complete data, it fails too! My first question is: is there a natural way to interpret these failures? My second question is: what should I do??? **Edit: for future readers who may encounter the same problem** , after going through the code of the functions in `polycor`... the solution is simply to use `hetcor()` with the option `std.err=FALSE`. This gives estimates very similar to those StasK gave. I lack time now to understand better what’s going on here! The questions below have been pretty well answered by StasK. I have other questions, but before anything, here is a url with a RData file containing a data frame `L1` containing only the complete data: data_sem.RData Here a few lines of codes showing the failure of `hetcor`.               > require("OpenMx")     > require("polycor")     > load("data_sem.RData")     > hetcor(L1)     Erreur dans cut.default(scale(x), c(-Inf, row.cuts, Inf)) :        'breaks' are not unique     De plus : Il y a eu 11 avis (utilisez warnings() pour les visionner)     > head(L1)        A1 A2 A3 A4 A5       B1       B2       B3 C1 D1 E1     1   4  5  4  5  7 -0.82759  0.01884 -3.34641  4  6  1     4   7  5  0  4  6 -0.18103  0.14364  0.35730  0  1  0     7   7  5  7  6  9 -0.61207 -0.18914  0.13943  0  0  0     10  5  5 10  7  3 -1.47414  0.10204  0.13943  2  0  0     11  7  5  8  9  9 -0.61207  0.06044 -0.73203  0  2  0     12  5  5  9 10  5  0.25000 -0.52192  1.44662  0  0  0      But I can still compute a correlation or a covariance matrix in a very dirty way, considering my ordered factors as quantitative variables:               > Cor0 <- cor(data.frame(lapply(L1, as.numeric)))      Here is a piece of `OpenMx` code together with my next question: is the following model correct? Not too much free parameters?               manif <- c("A1","A2","A3","A4","A5", "B1","B2","B3", "C1", "D1", "E1");          model1 <- mxModel(type="RAM",             manifestVars=manif, latentVars=c("A","B","C","D","E"),             # factor variance             mxPath(from=c("A","B","C","D","E"), arrows=2, free=FALSE, values = 1),             # factor covariance             mxPath(from="A", to="B",  arrows=2, values=0.5),             mxPath(from="A", to="C",  arrows=2, values=0.5),             mxPath(from="A", to="D",  arrows=2, values=0.5),             mxPath(from="A", to="E",  arrows=2, values=0.5),             mxPath(from="B", to="C",  arrows=2, values=0.5),             mxPath(from="B", to="D",  arrows=2, values=0.5),             mxPath(from="B", to="E",  arrows=2, values=0.5),             mxPath(from="C", to="D",  arrows=2, values=0.5),             mxPath(from="C", to="E",  arrows=2, values=0.5),             mxPath(from="D", to="E",  arrows=2, values=0.5),             # factors → manifest vars             mxPath(from="A", to=c("A1","A2","A3","A4","A5"), free=TRUE, values=1),             mxPath(from="B", to=c("B1","B2","B3"), free=TRUE, values=1),             mxPath(from="C", to=c("C1"), free=TRUE, values=1),             mxPath(from="D", to=c("D1"), free=TRUE, values=1),             mxPath(from="E", to=c("E1"), free=TRUE, values=1),             # error terms             mxPath(from=manif, arrows=2, values=1, free=TRUE),             # data             mxData(Cor0, type="cor",numObs=dim(L1)[1])            );      And one last question. With this model (let’s forget for a moment the inappropriate way the correlation matrix is computed), I run OpenMx:               > mxRun(model1) -> fit1     Running untitled1      > summary(fit1)      among the summary, this:               observed statistics:  55      estimated parameters:  32      degrees of freedom:  23      -2 log likelihood:  543.5287      saturated -2 log likelihood:  476.945      number of observations:  62      chi-square:  66.58374      p:  4.048787e-06       The fit seems very bad, despite the huge number of parameters. What does that mean? Does that mean that we should add covariances between manifest variables? Many thanks in advance for all your answers, I am slowly becoming insane...


title: How to compare different sensitivity thresholds and detection limits?

text: I have observations taken with different sensitivity thresholds and minimum detection levels, i.e. Lab A is less sensitive and has a minimum detection level of .2 and Lab B is more sensitive and has a minimum detection level of .02. _Edit 2: I have taken $N$ samples and have had them processed by two different labs (for stupid political reasons). Both labs send me the results and I discover that Lab A has a minimum detection level of .2 and Lab B has a minimum detection level of .02. See example:_ Each row corresponds to a unique measurement taken by either lab:               Obs | Lab A | Lab B     ---------------------      1  |  .6   |  NA      2  |  0    |  NA      3  |  NA   |  .53      4  |  .2   |  NA      5  |  NA   |  .07      _Edit 2: I would like to be able to use and combine results from both labs, as if they were on the same scale. The problem is that the labs used to process the samples have very different thresholds for detection and have different sensitivity levels._ I think I would like something like:               Obs | LabA  | LabB  | NewLab     ----------------------------      1  |  .6   |  NA   |  .64      2  |  0    |  NA   |  .13      3  |  NA   |  .53  |  .53      4  |  .2   |  NA   |  .21      5  |  NA   |  .07  |  .07      What techniques are available to standardize the values such that there is not a large loss of information?   1. Obviously, I could take the values from Lab B and replace anything less than .2 with 0 and then round them, but I want to avoid throwing away information if possible.   2. One person suggested to add random noise to the values of Lab A, but I'm not sure of the benefit of this vs. simply imputing the missing values from Lab B. _Edit 1:_ There are no observations for which both Lab A and Lab B values are present, one will always be missing. _Edit 2:_ What can I do to get results from both labs on a similar scale?


title: What resources/methods exist for testing/validation or evaluation of Statistical Methods

text: I'm interested in the process of testing or validating a particular implementation of a statistical method, and what datasets and/or published analysis exist that could be used to do this in practice. For instance, if I write an algorithm to implement a simple linear regression, I might feed in some numbers and check the result looks good, or I might feed numbers into my code and some other system and compare. In some cases, people seem to have already done this and then publish the numbers and results which could be defined as reference data. To start off, the best one I know is the NIST Statistical Reference Datasets page that publishes a wide range of datasets and calculations that covers areas such as Analysis of Variance, Linaear Regression, Markov Chain and Monte Carlo simulation and Non-Linear regression. Are there any other good / notable ones out there. Edit: I reworded to make clear that I'm not just looking for open datasets, but I'm interested in datasets and solutions to specific statistical problems that could be used to test an implementation of a technique.


title: Best books for an introduction to statistical data analysis?

text: I bought this book: How to Measure Anything: Finding the Value of Intangibles in Business and Head First Data Analysis: A Learner's Guide to Big Numbers, Statistics, and Good Decisions What other books would you recommend?


title: Example of using binomial distribution

text: Q: Is my approach correct? Event: You toss 5 coins at once. A student of mine claimed he got 4T & 1H in 39 out of 40 trials (!!) I decided to calc the odds of this... First, P(4T & 1H) = 5C4 * (1/2)^4 * (1/2)^1 = .16 I did this 2 ways: * * * 1) Binomial Probability n = 40 r = 39 p = .16 q = .84 P(Exactly 39) = 40 C 39 * (.16)^39 * (.84)^1 = 0% * * * 2) Binomial Distribution: n = 40 r = 39 (or more) p = .16 q = .84 E(X) = u = np = (.16)(40) = 6.4 SD = SQRT(npq) = 3.16 Z(39) = (observed - expected) / SD = (39 - 6.4) / 3.16 = 10.3 p = P( Z > 10.3) = 0% * * * Conclusion: The odds of getting 4T & 1H in 39 out of 40 trials is negligible. Student was on drugs at the time.


title: Finding the full conditional posterior for $\beta$

text: So I have the following question from my textbook, the answer I get is slightly different from the book's answer, which I think may be wrong, could someone please confirm? **Question:** Suppose $y_{1:T} = (y_1, y_2, \cdots, y_T)'$ is a sample of $T = 20$ Poisson random variables such that: $y_t|\theta_1 \stackrel{i.i.d}{\sim} Poisson(\theta_1) \ \text{for} \ t=1, 2, \dots, T_1=10$ $y_t|\theta_2 \stackrel{i.i.d}{\sim} Poisson(\theta_2) \ \text{for} \ t=T_1+1, 2, \dots, T=T_1+T_2$ where $T_2 = 10$ Now assume that the parameters of the two Poisson distributions, $\theta_1$ and $\theta_2$, are independent draws from a $Gamma(shape = \alpha, scale = \beta)$ distribution, ie, $$\theta_1, \theta_2 \stackrel{i.i.d}{\sim} Gamma(shape = \alpha, scale = \beta)$$ where $\alpha$ is known but $\beta$ is not known. Finally, place a prior distribution on $\beta$, given by: $$\beta \sim InverseGamma(shape=w, scale = \tau)$$ where $w$ and $\tau$ are both assumed to be known. Find the full posterior conditional for $\beta$, that is, find the distribution $\beta|\theta_1, \theta_2, y_{1:T}$. **My working:** We have: \begin{align*}\displaystyle p(y_t|\theta_1) = \frac{\theta_1^{y_t}\exp(-\theta_1)}{y_t!} \ \ \ \ \text{for} \ t=1, 2, \cdots, T_1\end{align*} Hence: \begin{align*}p(y_{1:T_1}|\theta_1) = \prod_{t=1}^{T_1} \frac{\theta_1^{y_t}\exp(-\theta_1)}{y_t!} = \frac{\theta_1^{\sum_{t=1}^{T_1} y_t}\exp(-T_1 \theta_1)}{\prod_{t=1}^{T_1}(y_t!)} \end{align*} Likewise: \begin{align*}\displaystyle p(y_t|\theta_2) = \frac{\theta_2^{y_t}\exp(-\theta_2)}{y_t!} \ \ \ \ \text{for} \ t=T_1+1, T_1+2, \cdots, T=T_1+T_2\end{align*} Hence: \begin{align*}p(y_{T_1+1:T_1+T_2}|\theta_2) = \prod_{t=T_1+1}^{T_1+T_2} \frac{\theta_2^{y_t}\exp(-\theta_2)}{y_t!} = \frac{\theta_2^{\sum_{t=T_1+1}^{T_1+T_2} y_t}\exp(-T_2 \theta_2)}{\prod_{t=T_1+1}^{T_1+T_2}(y_t!)} \end{align*} Since $y_t|\theta_1$ for $t = 1, 2, \cdots, T_1$ are independent from $y_t|\theta_2$ for $t=T_1+1, T_1+2, \cdots, T=T_1+T_2$, the likelihood is given by: \begin{align*} p(y_{1:T}|\theta_1, \theta_2) & = p(y_{1:T_1}|\theta_1) \times p(y_{T_1+1:T_1+T_2}|\theta_2) \\\ & = \frac{\theta_1^{\sum_{t=1}^{T_1} y_t}\exp(-T_1 \theta_1)}{\prod_{t=1}^{T_1}(y_t!)} \times \frac{\theta_2^{\sum_{t=T_1+1}^{T_1+T_2} y_t}\exp(-T_2 \theta_2)}{\prod_{t=T_1+1}^{T_1+T_2}(y_t!)} \\\ & = \frac{\theta_1^{\sum_{t=1}^{T_1}y_t}\theta_2^{\sum_{t=T_1+1}^{T_1+T_2}y_t}\exp(-T_1\theta_1-T_2\theta_2)}{\prod_{t=1}^{T_1+T_2}(y_t!)} \end{align*} The prior is given by: \begin{align*} p(\theta_1, \theta_2, \beta) & = p(\theta_1, \theta_2|\beta)p(\beta) \\\ & = p(\theta_1|\beta)p(\theta_2|\beta)p(\beta) \\\ & = \frac{\theta_1^{\alpha-1}}{\beta^{\alpha}\Gamma(\alpha)}\exp\left(-\frac{\theta_1}{\beta}\right) \times \frac{\theta_2^{\alpha-1}}{\beta^{\alpha}\Gamma(\alpha)}\exp\left(-\frac{\theta_2}{\beta}\right) \times \frac{\tau^{w}}{\Gamma(w)\beta^{w+1}}\exp\left(-\frac{\tau}{\beta}\right) \\\ & = \frac{(\theta_1\theta_2)^{\alpha-1}\tau^w\exp\left(-\frac{1}{\beta}\left(\theta_1+\theta_2+\tau\right)\right)}{\beta^{2\alpha+w+1}\left(\Gamma(\alpha)\right)^2\Gamma(w)} \end{align*} Thus the joint density for $(\theta_1, \theta_2, \beta, y_{1:T})$ is given by: \begin{align*} p(\theta_1, \theta_2, \beta, y_{1:T}) = \frac{\theta_1^{\sum_{t=1}^{T_1}y_t + \alpha -1}\theta_2^{\sum_{t=T_1+1}^{T_1+T_2}y_t + \alpha -1}\tau^w\exp\left(-T_1\theta_1-T_2\theta_2-\frac{1}{\beta}\left(\theta_1+\theta_2+\tau\right)\right)}{\prod_{t=1}^{T_1+T_2}(y_t!)\beta^{2\alpha+w+1}\left(\Gamma(\alpha)\right)^2\Gamma(w)} \end{align*} Hence a kernel for the joint posterior density of $(\theta_1, \theta_2, \beta)$ is given by: \begin{align*} p(\theta_1, \theta_2, \beta|y_{1:T}) \propto \frac{\theta_1^{\sum_{t=1}^{T_1}y_t + \alpha -1}\theta_2^{\sum_{t=T_1+1}^{T_1+T_2}y_t + \alpha -1}\exp\left(-T_1\theta_1-T_2\theta_2-\frac{1}{\beta}\left(\theta_1+\theta_2+\tau\right)\right)}{\beta^{2\alpha+w+1}} \end{align*} The full conditional for $\beta$ is given by: \begin{align*} p(\beta|\theta_1, \theta_2, y_{1:T}) & \propto \frac{\exp\left(-\frac{1}{\beta}\left(\theta_1+\theta_2+\tau\right)\right)}{\beta^{2\alpha+w+1}} \\\ & = \frac{1}{\beta^{2\alpha+w+1}}\exp\left(-\frac{\theta_1+\theta_2+\tau}{\beta}\right) \end{align*} Hence $\beta|\theta_1, \theta_2, y_{1:T} \sim InverseGamma\left(shape=2\alpha+w, scale=\theta_1+\theta_2+\tau\right)$ **Book's answer:** $\beta|\theta_1, \theta_2, y_{1:T} \sim InverseGamma\left(shape=2\alpha+w, scale=\theta_1+\theta_2+1/\tau\right)$ Where'd that $1/\tau$ come from? I don't think it's correct.


title: What's the relation among regression and classification?

text: I saw almost each regression method corresponds to a classification method. for example, adaboost classification, adaboost regression. What is the relationship between them? Can I get a regression method from a classification method immediately?


title: Test for significant difference in ratios of normally distributed random variables

text: Related to Analysing ratios of variables and How to parameterize the ratio of two normally distributed variables, or the inverse of one?. Suppose I have a number of samples from four different continous random distributions, all of which we can assume to be roughly normal. In my case, these correspond to some performance metrics of two different filesystems (say, ext4 and XFS), both with and without encryption. The metric might be, for example, the number of files created per second, or the average latency for some file operation. We can assume that all samples drawn from these distributions will always be strictly positive. Let's call these distributions $\textrm{Perf}_{fstype,encryption}$ where $fstype \in \\{xfs,ext4\\}$ and $encryption \in \\{crypto,nocrypto\\}$. Now, my hypothesis is that encryption slows down one of the filesystems by a bigger factor than the other. Is there some simple test for the hypothesis $\frac{E[\textrm{Perf}_{xfs,crypto}]}{E[\textrm{Perf}_{xfs,nocrypto}]} < \frac{E[\textrm{Perf}_{ext4,crypto}]}{E[\textrm{Perf}_{ext4,nocrypto}]}$?


title: What is the level of measurement of image data?

text: Question: This is a bit of an abstract question, but bear with me. I am averaging images, to try and deduce what the average image of a specific subject looks like (just out of curiosity, it might produce some interesting results). In order to know what kind of averaging method is permitted, i am trying to determine as what kind of data images can be classified (nominal, ordinal, interval or ratio). I would think a collection of images from a specific subject (creative commons portraits scraped from flickr for example) can be classified as nominal data, since there is no sense in ordering portraits (which would make it ordinal data, or higher). In my opinion the images are on the same level as names, but instead of a linguistic representation of something, they are a visual representation of something (thereby functioning on the same level as a name). Which would make it nominal data. But then again: digital images are in essence an array of numbers (rgb values), which could mean that it's measured at the ratio level (or at least the colors are). **So a mean average is _possible_ , but is it sensible?** * * * My other question should clarify what it is i am trying to achieve: Averaging images


title: Testing statistical significance in two conditions

text: I am measuring two unpaired variables $x$ and $y$ in two different conditions ($x$ and $y$ are magnitudes of some special magnetic signals). In the first condition, my hypothesis is that $\bar{x} > \bar{y}$ and in the second condition that $\bar{x} < \bar{y}$. Now that I have $N$ samples from both variables, how can I test whether my hypotheses are true? I am not sure if I can safely assume that $x$ and $y$ are independent from each other. Neither do I know from what kind of distributions they are sampled from. The sample size I have is small. I have read several introductions to statistics for the past few days, but never saw a worked out example for this kind of situations. All help appreciated. Edit: Like Michael Mayer wrote, there is a binary grouping variable "condition". Sorry for a bit unclear question.


title: Choosing between best two attributes with the same information gain when building decision tree

text: When building a decision tree, suppose that there are two attributes that have the same maximum information gain. Will there be any difference between choosing any of the two attributes to be a tree node? Or are there any other factors that I have to consider in order to decide which attribute should I choose?


title: Ordering ratios

text: We have an experiment where we observe a random number of objects (samples) and we measure how many of those are defective. Imagine that this is done in different factories that they produce these objects in different speeds, so 1 factory might produce 1 object a day, and others 1000 or more. Is there any formal way (or any ideas) to produce an ordering of the factories that reflects how defective products they have (from the worse to the best)? The problem is that if we take into account only the ratio $\frac{defectives}{observed}$ it does not produce a "fair" ordering since $\frac{1~defective}{2~observed}=\frac{20~defective}{40~observed}$ while the second ratio should be considered worse since it has a bigger sample.