tag:blogger.com,1999:blog-8909074830238091680.comments2018-05-21T12:45:47.339+10:00Jeromy Anglim's Blog: Psychology and StatisticsJeromy Anglimnoreply@blogger.comBlogger855125tag:blogger.com,1999:blog-8909074830238091680.post-74379005147831170872017-04-25T13:03:02.786+10:002017-04-25T13:03:02.786+10:00Hi, I’m trying to plot a barplot with 3 categorica...Hi, I’m trying to plot a barplot with 3 categoricals by one continuous variable. It’s easy to do in an excel or google spreadsheet, but the ggplot2 code is a bit hard, but I think might be similar to what you've done. What I need is the y axis data (V) grouped by two time periods (0, 60) for one categorical group (NW, OB) and another (M,F) so you have four bars in two groups (by gender and by body weight). I’m using the mean values of V for each group rather than the whole dataset. The values are V0M 1.680 V0F 1.59 V60M 1.673, V60F 1.479, V0NW 1.679, V60NW 1.69 V0OB 1.613, V60OB 1.507 <br /><br />I tried your code but couldn’t make it work. Can you help me with this?JUAN Thttps://www.blogger.com/profile/12472831132482094173noreply@blogger.comtag:blogger.com,1999:blog-8909074830238091680.post-83525102511538933382017-04-04T10:08:23.990+10:002017-04-04T10:08:23.990+10:00Your huxtable package looks quite user-friendly an...Your huxtable package looks quite user-friendly and flexible. Is there a minimal example of exporting a single table to Word using ReporteRs?Jeromy Anglimhttps://www.blogger.com/profile/12949204812496382042noreply@blogger.comtag:blogger.com,1999:blog-8909074830238091680.post-39316460896029494022017-04-04T00:35:31.326+10:002017-04-04T00:35:31.326+10:00Some more modern packages you might want to look a...Some more modern packages you might want to look at: `formattable`, `pixiedust` and `huxtable` (my own). All of them are for formatting tables with in R and can export LaTeX and HTML, `huxtable` can do Word via the `ReporteRs` package, which is itself worth looking at. There's a comparison chart at https://hughjonesd.github.io/huxtable/design-principles.htmlDavid Hugh-Joneshttps://www.blogger.com/profile/01123256773062047048noreply@blogger.comtag:blogger.com,1999:blog-8909074830238091680.post-83973447563672441142017-03-27T11:54:12.023+11:002017-03-27T11:54:12.023+11:00Nice post. Curious about an issue I've had wit...Nice post. Curious about an issue I've had with a few different datasets. The difference scores have been between two conditions in a repeated measures experiment. I want to predict the difference across conditions with a continuous variable. What would be the arguments for and against using 1) a repeated measures ANOVA with an interaction effect between the condition variable and the continuous variable versus 2) a linear regression where the continuous variable predicts the difference scores across the conditions versus 3) some third alternative I am not aware of.David Disabatohttps://www.blogger.com/profile/16649701800835594139noreply@blogger.comtag:blogger.com,1999:blog-8909074830238091680.post-81904678748150485872017-03-20T01:32:12.618+11:002017-03-20T01:32:12.618+11:00Hi,
I am having trouble understanding the sources...Hi,<br /><br />I am having trouble understanding the sources of variation in an ANOVA. I am looking at the following: <br /><br /> 2 (male vs. female) x 2 (student vs. non-student) x 2 (British vs. non-British) ANOVA examining positivity towards Brexit<br /><br />So what would be the sources of variation? <br /><br /><br />Kind regards,<br /><br />Sophia Unknownhttps://www.blogger.com/profile/04058432454598118332noreply@blogger.comtag:blogger.com,1999:blog-8909074830238091680.post-89269722719711091752017-03-20T01:32:11.678+11:002017-03-20T01:32:11.678+11:00Hi,
I am having trouble understanding the sources...Hi,<br /><br />I am having trouble understanding the sources of variation in an ANOVA. I am looking at the following: <br /><br /> 2 (male vs. female) x 2 (student vs. non-student) x 2 (British vs. non-British) ANOVA examining positivity towards Brexit<br /><br />So what would be the sources of variation? <br /><br /><br />Kind regards,<br /><br />Sophia Unknownhttps://www.blogger.com/profile/04058432454598118332noreply@blogger.comtag:blogger.com,1999:blog-8909074830238091680.post-38303850474208622442017-03-07T05:42:46.083+11:002017-03-07T05:42:46.083+11:00Hello Jeromy
Would you please check and answer my...Hello Jeromy<br /><br />Would you please check and answer my question, if it is possible for you:<br /><br />http://stats.stackexchange.com/questions/265663/how-i-can-statistically-tell-a-value-remain-constant<br /><br />Thanks<br />HamedUnknownhttps://www.blogger.com/profile/09676292403131014091noreply@blogger.comtag:blogger.com,1999:blog-8909074830238091680.post-61223062868791563402017-02-12T10:51:17.942+11:002017-02-12T10:51:17.942+11:00Hi Jeromy,
I have several neuropsychological tes...Hi Jeromy, <br /><br />I have several neuropsychological test variables, highly correlated, that are all T scores from normative data sets. I might be overlooking something, but it seems as though I have the option of creating a z-score composite as you described (which would then be based on the variability of my data) or combining T scores for a similar composite score since the scores are already standardized and in the same metric. It also may be important to note that I am using a patient population, so my distribution is not necessarily the same as the normative sample the scores are based on. This is for my dissertation, so it is also possible that I have been over thinking it quite a bit and should just the procedures you have above. <br /><br />Any thoughts or advice would be greatly appreciated. Unknownhttps://www.blogger.com/profile/06100865529296695538noreply@blogger.comtag:blogger.com,1999:blog-8909074830238091680.post-90842351625605850192017-01-20T02:24:20.183+11:002017-01-20T02:24:20.183+11:00Hi Jeromy,
I was wondering if you could help me. ...Hi Jeromy,<br /><br />I was wondering if you could help me. I've conducted an EFA with oblique rotation. I extracted 2 factors and computed regression based factor scores. Factor 1 was interpreted to represent “Personal and Private Use” and factor 2 represents “Confidence, social and creative use”. I want to combine the factor scores into a single score/index of Digital Literacy because I intend to map it later. I found someone who used the proportion of explained variance of each factor as weights on the factor scores to create a "Non-Standarized Index" and then standarized it. (http://www.cup.ualberta.ca/wp-content/uploads/2013/04/SEICUPWebsite_10April13.pdf). <br /><br />Does this makes sense? And how would I do this in R?<br />Graciela Carrillohttps://www.blogger.com/profile/13450017802273261731noreply@blogger.comtag:blogger.com,1999:blog-8909074830238091680.post-79967218312438172392017-01-17T01:46:38.794+11:002017-01-17T01:46:38.794+11:00Dear Jeromy, I have question related to topic disc...Dear Jeromy, I have question related to topic discussed on this page. I have trying to create a composite score by combining multiple continuous variables( e.g height , weight, blood pressure etc). One easy way is to standardize the variable and run factor analysis and get the overall score. But my problem the factor scores are in z score ( meaning 0 mean and 1 sd), which is difficult to understand mean change over time between individual and within same individual across different time point. Do you have any other suggestion ? How we create composite score with actual mean ? <br /><br />Thank you in advanceJotheeswaran Thiyagarajanhttps://www.blogger.com/profile/17239981851817527682noreply@blogger.comtag:blogger.com,1999:blog-8909074830238091680.post-75352897942417267362017-01-06T03:56:42.214+11:002017-01-06T03:56:42.214+11:00Hello, I want to present a correlation table with ...Hello, I want to present a correlation table with correlations among women and men seperately. I also want to include in this table the significance tests on correlations. Do you have a recommendation how to visually include it in the table? I haven't seen it in articles.Unknownhttps://www.blogger.com/profile/03409245066038202368noreply@blogger.comtag:blogger.com,1999:blog-8909074830238091680.post-78963057613124573032017-01-04T08:04:01.319+11:002017-01-04T08:04:01.319+11:00Dear Jeromy!
Thank you very much indeed for putti...Dear Jeromy!<br /><br />Thank you very much indeed for putting this site...<br /><br />I have a question: You show -in your post-, some p-values... and these have a low p-values, this is good or bad?<br /><br />for example:<br />> factanal(personality[items], factors = 5, rotation = "none");<br />...<br />The p-value is 2.3e-16 <br /><br />Any suggestions or advice would be very helpful.<br />Thank you<br /><br />Luz Stella<br />Cartagena, ColombiaLuzhttps://www.blogger.com/profile/03660619523303134852noreply@blogger.comtag:blogger.com,1999:blog-8909074830238091680.post-77964879145523156082017-01-03T14:57:35.275+11:002017-01-03T14:57:35.275+11:00Dear Jeromy!
Thank you very much indeed for putti...Dear Jeromy!<br /><br />Thank you very much indeed for putting this site...<br /><br />I have a question: You show -in your post-, some p-values... and these have a low p-values, this is good or bad?<br /><br />for example:<br />> factanal(personality[items], factors = 5, rotation = "none");<br />...<br />The p-value is 2.3e-16 <br /><br />Any suggestions or advice would be very helpful.<br />Thank you<br /><br />Luz Stella<br />Cartagena, ColombiaLuzhttps://www.blogger.com/profile/03660619523303134852noreply@blogger.comtag:blogger.com,1999:blog-8909074830238091680.post-70414698553052356272016-12-17T20:04:46.835+11:002016-12-17T20:04:46.835+11:00Cumulative poisson probability function in R ? I n...Cumulative poisson probability function in R ? I need to find it without usin ppois and dpoisMirali Hasanzadehhttps://www.blogger.com/profile/09181680718470552448noreply@blogger.comtag:blogger.com,1999:blog-8909074830238091680.post-16344439063465746922016-11-25T12:57:29.909+11:002016-11-25T12:57:29.909+11:00Hello Jeromy
Thanks for your useful stuff, it real...Hello Jeromy<br />Thanks for your useful stuff, it really helpful; I have a tinies questions regarding statistics if you can help, that would be great.<br />Q) I have a questionnaire survey has 92 items with valid 196 responses, and I would like to reduce the items, what is the best way to reduce? is it by Factor Analysis (FA), or Corrected Item-Total Correlation or what? <br />My research required to do FA them SEM and the number of items is quite large comparing with the responses.<br />Thanks a lot for helping<br />Moath<br />moathhttps://www.blogger.com/profile/05457502113458181997noreply@blogger.comtag:blogger.com,1999:blog-8909074830238091680.post-4865647164817869122016-11-23T20:48:08.917+11:002016-11-23T20:48:08.917+11:00Thank you Jeromy Anglim for the wonderful clear ex...Thank you Jeromy Anglim for the wonderful clear explanation. i have a follow-up question. Is it possible to create a range for the composite z-score ? I wanted to use the composite z score in multilevel modeling an predict the change over time. <br />Looking forward to your advice. Jotheeswaran Thiyagarajanhttps://www.blogger.com/profile/17239981851817527682noreply@blogger.comtag:blogger.com,1999:blog-8909074830238091680.post-50557600907351044172016-11-23T20:42:11.488+11:002016-11-23T20:42:11.488+11:00Dear Jeromy,
Thank you very much for very clear ...Dear Jeromy, <br /><br />Thank you very much for very clear explanation. The explanation you provide solved many questions in my mind. However, I wanted to know whether it is possible to create range for Z composite score ?<br /><br />Thank you in advance, <br /><br />Regards, JotheesUnknownhttps://www.blogger.com/profile/17239981851817527682noreply@blogger.comtag:blogger.com,1999:blog-8909074830238091680.post-79738085962431292082016-10-26T02:13:26.857+11:002016-10-26T02:13:26.857+11:00Hi Jeromy, Thanks for this great post. I have a qu...Hi Jeromy, Thanks for this great post. I have a question about composite scores for longitudinal data. I understand that in order to measure change from time A to B it is necessary to use a common mean and standard deviation for z-standardization at both time points. You have pointed out that it should be fine to use either the pooled mean and SD from both time points (that is, from the combined distribution of scores at times A and B), or to use the mean and SD at time A for standardizing A as well as B.<br /><br />Could you provide a reference for these points? I ask because I recently used the pooled approach and reviewers have expressed concern about using scores from two time points to create z-scores. <br />Cindyhttps://www.blogger.com/profile/02057675750792738211noreply@blogger.comtag:blogger.com,1999:blog-8909074830238091680.post-30786450522185287722016-09-28T18:01:59.613+10:002016-09-28T18:01:59.613+10:00Thank you for your clear explanation!
I have creat...Thank you for your clear explanation!<br />I have created 4 z scores for my 4 variables that all had different scales. I then added the z scores together to make my composite score. However my new composite scale now has negative values, as does the 4 z scores. I believe z scores should be viewed as absolute values. My original scores were all positive (responses range 1-4, 1-5, or 1-7). So how do I get spss to work with the negative z scores as absolute values? <br />I appreciate any insight you can offer.<br />Many thanks. JaneJanehttps://www.blogger.com/profile/08508579025458692673noreply@blogger.comtag:blogger.com,1999:blog-8909074830238091680.post-64916715677675450362016-09-12T10:33:54.330+10:002016-09-12T10:33:54.330+10:00You could check out this tutorial example of facto...You could check out this tutorial example of factor analysis where everything is available:<br />https://github.com/jeromyanglim/r-vandenberghe-exerciseJeromy Anglimhttps://www.blogger.com/profile/12949204812496382042noreply@blogger.comtag:blogger.com,1999:blog-8909074830238091680.post-75772597858306309652016-09-12T10:32:47.154+10:002016-09-12T10:32:47.154+10:00Of course, just use read.csv() to import the data....Of course, just use read.csv() to import the data.Jeromy Anglimhttps://www.blogger.com/profile/12949204812496382042noreply@blogger.comtag:blogger.com,1999:blog-8909074830238091680.post-68854913212530687092016-09-12T10:32:17.096+10:002016-09-12T10:32:17.096+10:00You can use the composite z-score to create high a...You can use the composite z-score to create high and low scoring groups. If you were creating a cut-off, you could either use a simple rule like above and below the mean or median. Or you could think about the component scales and think about a relevant criteria of performance based on substantive knowledge.<br /><br />However, in general, I would strongly discourage you from creating high-low groups. Instead, use the continuous version variable. i.e., instead of comparing group means on another variable, run a correlation or a regression.<br />You'll get much better prediction.Jeromy Anglimhttps://www.blogger.com/profile/12949204812496382042noreply@blogger.comtag:blogger.com,1999:blog-8909074830238091680.post-32495028792906536632016-09-12T10:29:21.241+10:002016-09-12T10:29:21.241+10:00I'm no expert. Perhaps post your specific ques...I'm no expert. Perhaps post your specific question to http://tex.stackexchange.com<br /><br />You may get a good answer there.Jeromy Anglimhttps://www.blogger.com/profile/12949204812496382042noreply@blogger.comtag:blogger.com,1999:blog-8909074830238091680.post-29780369172985231022016-09-05T17:39:38.825+10:002016-09-05T17:39:38.825+10:00Can you use a csv file for this instead of a spss ...Can you use a csv file for this instead of a spss .sav file?Yashuhttps://www.blogger.com/profile/11050211218829055934noreply@blogger.comtag:blogger.com,1999:blog-8909074830238091680.post-35976505011855492072016-09-01T19:29:01.305+10:002016-09-01T19:29:01.305+10:00Hi Jeromy, Thanks for such a detailed explanation ...Hi Jeromy, Thanks for such a detailed explanation on composite score. I have performance scores (No. of correct responses) on two tests on different metrics. I have converted both of these into z-scores and combined them to get a composite z-score in SPSS. However, the question I have is can I use the composite z-score to divide my sample to 2 sub-groups for comparisons on a different set of language and congitive tasks? The composite z-scores vary from a range of negative to positive values. I am not quite sure how to decide on a cut-off score based on the composite z-score to divide the sample to two sub-groups for further comaprisons.Anusha Balasubramanianhttps://www.blogger.com/profile/17594050974004926985noreply@blogger.com