tag:blogger.com,1999:blog-8909074830238091680.comments2020-11-07T19:25:52.722+11:00Jeromy Anglim's Blog: Psychology and Statisticsjeromyanglimhttp://www.blogger.com/profile/12949204812496382042noreply@blogger.comBlogger858125tag:blogger.com,1999:blog-8909074830238091680.post-86625444198432329522020-08-14T09:41:20.601+10:002020-08-14T09:41:20.601+10:00Re your idea about dates, that makes a lot of sens...Re your idea about dates, that makes a lot of sense. I err on date names being more human readable and relying on the date modified where I want to actually sort by date. In general, it's pretty rare that I find myself going back into an archived version of a file.jeromyanglimhttps://www.blogger.com/profile/12949204812496382042noreply@blogger.comtag:blogger.com,1999:blog-8909074830238091680.post-70963392324379425412020-08-12T03:54:30.621+10:002020-08-12T03:54:30.621+10:00 Really nice setup. I think I am going to impleme... Really nice setup. I think I am going to implement it in the same way. Thanks!Mónica Cortiñashttps://www.blogger.com/profile/10901896109533575778noreply@blogger.comtag:blogger.com,1999:blog-8909074830238091680.post-33292412569612882602020-08-06T19:52:12.633+10:002020-08-06T19:52:12.633+10:00I know you can sort files by last modified date, b...I know you can sort files by last modified date, but wouldn't it make more sense to append dates in the format yyyy-MM-dd? That means they're sorted in chronological order by default.<br /><br />I hadn't thought of appending storage type to the directory, it's a great way to easily separate related project files that I don't want stored remotely.Fodderhttps://www.blogger.com/profile/13165242975795347935noreply@blogger.comtag: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?jeromyanglimhttps://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.htmldavidhughjoneshttps://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.Anonymoushttps://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 mmmmhttps://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 mmmmhttps://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 />HamedAnonymoushttps://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. Anonymoushttps://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 />Anonymoushttps://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 advanceAnonymoushttps://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.Orlyhttps://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 dpoisAnonymoushttps://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. Anonymoushttps://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, JotheesAnonymoushttps://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-exercisejeromyanglimhttps://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.jeromyanglimhttps://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.jeromyanglimhttps://www.blogger.com/profile/12949204812496382042noreply@blogger.com