tag:blogger.com,1999:blog-1275149608391671670.comments2017-06-23T09:32:02.949-04:00SAS and RKen Kleinmanhttp://www.blogger.com/profile/09525118721291529157noreply@blogger.comBlogger599125tag:blogger.com,1999:blog-1275149608391671670.post-53208635719295031732017-06-20T18:37:31.012-04:002017-06-20T18:37:31.012-04:00I've found Sonja Swanson's excellent paper...I've found Sonja Swanson's excellent paper to be helpful with those questions:<br /><br />https://www.ncbi.nlm.nih.gov/pubmed/21882219<br /><br />A Monte Carlo investigation of factors influencing latent class analysis: an application to eating disorder research.<br /><br />Swanson SA1, Lindenberg K, Bauer S, Crosby RD.<br />Author information<br />Abstract<br />OBJECTIVE:<br />Latent class analysis (LCA) has frequently been used to identify qualitatively distinct phenotypes of disordered eating. However, little consideration has been given to methodological factors that may influence the accuracy of these results.<br />METHOD:<br />Monte Carlo simulations were used to evaluate methodological factors that may influence the accuracy of LCA under scenarios similar to those seen in previous eating disorder research.<br />RESULTS:<br />Under these scenarios, the aBIC provided the best overall performance as an information criterion, requiring sample sizes of 300 in both balanced and unbalanced structures to achieve accuracy proportions of at least 80%. The BIC and cAIC required larger samples to achieve comparable performance, while the AIC performed poorly universally in comparison. Accuracy generally was lower with unbalanced classes, fewer indicators, greater or nonrandom missing data, conditional independence assumption violations, and lower base rates of indicator endorsement.<br />DISCUSSION:<br />These results provide critical information for interpreting previous LCA research and designing future classification studies.Nick Hortonhttp://www.blogger.com/profile/00242216324355342047noreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-68764514120417604042017-06-20T14:06:58.328-04:002017-06-20T14:06:58.328-04:00Hi
I wonder how I can compare the fit statistics w...Hi<br />I wonder how I can compare the fit statistics when I have more than 25 variables. which one is more reliable (log liklihood, G-square, AIC, BIC, CAIC, Adjusted BIC or Entropy)? <br />Thanks by advanceAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-9879021711331272442017-06-09T10:07:06.704-04:002017-06-09T10:07:06.704-04:00Nope, the coding doesn't matter. If you make ...Nope, the coding doesn't matter. If you make the switch this will just cause all of your parameter estimates to flip sign. (I'd encourage you to try this on a minimally reproducible example.)<br /><br />NickNick Hortonhttp://www.blogger.com/profile/00242216324355342047noreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-41886097893528899372017-06-08T15:38:28.349-04:002017-06-08T15:38:28.349-04:00Hi,
I am conducting an LCA and am wondering if ho...Hi,<br /><br />I am conducting an LCA and am wondering if how you code your binary indicators matters? For example 1=yes and 2=no verses 1=no and 2=yes. <br />Jenni Millerhttp://www.blogger.com/profile/12912475051931063784noreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-16170092488322615112017-05-26T10:31:58.667-04:002017-05-26T10:31:58.667-04:00Hi Isabella--
This is a good question. In genera...Hi Isabella--<br /><br />This is a good question. In general in R, you can use relevel() to change the reference category for a factor variable. But it doesn't seem to work for the varIdent() function used here!<br /><br />For example, in the code below, the variances are identical. I think to do what you want, you might have to recode the factor manually!<br /><br />milk$mc4 = relevel(milk$mc, ref=4)<br /><br />mod = gls(value~mc, data=milk, weights = varIdent(form = ~1|mc), method="ML")<br />mod_ref4 = gls(value~mc4, data=milk, weights = varIdent(form = ~1|mc4), method="ML")<br /><br />mod$modelStruct$varStruct<br />mod_ref4$modelStruct$varStruct<br /><br /><br />Ken Kleinmanhttp://www.blogger.com/profile/09525118721291529157noreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-20213210247869089682017-05-25T23:39:55.779-04:002017-05-25T23:39:55.779-04:00Hi Ken,
Is it possible to control the reference ...Hi Ken, <br /><br />Is it possible to control the reference level of mc in the formula weights = varIdent(form = ~1|mc) so as to force R to construct and report ratios of variances which reflect the choice of reference level? <br /><br />Thanks,<br /><br />IsabellaIsabella R. Ghement, Ph.D.http://www.blogger.com/profile/12764806870780813453noreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-69018454721884766032017-04-23T09:50:11.461-04:002017-04-23T09:50:11.461-04:00Fixed! Thanks for pointing this out.Fixed! Thanks for pointing this out.Nick Hortonhttp://www.blogger.com/profile/00242216324355342047noreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-56612118008807804822017-04-20T09:44:28.892-04:002017-04-20T09:44:28.892-04:00in the R example you forgot to define the data.fra...in the R example you forgot to define the data.frame "ds" before to use survfit(...)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-9038513719795636012017-03-23T08:19:24.781-04:002017-03-23T08:19:24.781-04:00Hi,
Thanks for this post, but what would you do ...Hi, <br /><br />Thanks for this post, but what would you do if you have age as the time scale? I have data set up as a single individual per row with the model statment written as: <br />(age_in, age_out)*no_deaths (0)=drug_type<br /><br />How do you assess proportional hazards in this case? I can't put in (age_out-age_in) as the x in the sgplot command... <br /><br />Thanks!<br /><br />March 23, 2017Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-27173556732360626252017-03-23T08:18:21.824-04:002017-03-23T08:18:21.824-04:00This comment has been removed by the author.Dana Cullenhttp://www.blogger.com/profile/18393628322054247472noreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-28530592672743574672017-03-06T08:43:30.204-05:002017-03-06T08:43:30.204-05:00Hello everybody,
I am conducting an LTA analysis ...Hello everybody,<br /><br />I am conducting an LTA analysis and, in my case, the % of seeds in the best fitting model is 48%. I have seen that your example has 40% seeds. What is the minimum % needed for the model to be identified?<br />Thank you in advance :)<br /><br />best wishes,Isabelnoreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-29939571565831624942017-01-29T15:07:44.301-05:002017-01-29T15:07:44.301-05:00How to simulate Cure Rate Models in R?How to simulate Cure Rate Models in R?Arpanhttp://www.blogger.com/profile/01421681035039674931noreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-56137809552395439452016-12-22T14:41:30.689-05:002016-12-22T14:41:30.689-05:00The abline() function plots the OLS regression ont...The abline() function plots the OLS regression onto an existing plot. So you can just add <br /><br />abline(coef = coef(lm(y~x)))<br /><br />after the plot() function in the existing code.Ken Kleinmanhttp://www.blogger.com/profile/09525118721291529157noreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-71905596425240310652016-12-19T06:22:43.781-05:002016-12-19T06:22:43.781-05:00Hello community,
i am using the R code of Mr. Ken ...Hello community,<br />i am using the R code of Mr. Ken to generate the graph and it works.<br />I would like to ask now what do i need to add to this code in order to get a regression line.<br />My code is:<br />scatterhist = function(x, y, xlab="1", ylab="2"){<br /> zones=matrix(c(2,0,1,3), ncol=2, byrow=TRUE)<br /> layout(zones, widths=c(4/5,1/5), heights=c(1/5,4/5))<br /> xhist = hist(x, plot=FALSE)<br /> yhist = hist(y, plot=FALSE)<br /> top = max(c(xhist$counts, yhist$counts))<br /> par(mar=c(3,3,1,1))<br /> plot(x,y)<br /> par(mar=c(0,3,1,1))<br /> barplot(xhist$counts, axes=FALSE, ylim=c(0, top), space=0)<br /> par(mar=c(3,0,1,1))<br /> barplot(yhist$counts, axes=FALSE, xlim=c(0, top), space=0, horiz=TRUE)<br /> par(oma=c(3,3,0,0))<br /> mtext(xlab, side=1, line=1, outer=TRUE, adj=0, <br /> at=.8 * (mean(x) - min(x))/(max(x)-min(x)))<br /> mtext(ylab, side=2, line=1, outer=TRUE, adj=0, <br /> at=(.8 * (mean(y) - min(y))/(max(y) - min(y))))<br />}<br />ds = read.csv("popAhohenheim.csv", header = T, sep = ";",dec = ",", na.strings= "*", stringsAsFactors = F )<br />with(ds, scatterhist(AES, Flowering, xlab="AES", ylab="Flowering"))<br /><br /><br />Best wishesa ahttp://www.blogger.com/profile/03266750402365558610noreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-53321163190282785392016-12-16T20:05:03.128-05:002016-12-16T20:05:03.128-05:00Thank you for this amazing post. I manage to get i...Thank you for this amazing post. I manage to get it up and running and hit a snag. To enable ports, you now need to add "Custom", "-1" and "0 - 65535" under Application, Protocol, Port range respectively. Seems that Amazon Lightsail just tweaked something at their end.Mr. Yaphttp://www.blogger.com/profile/03827605488440814343noreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-39691185427118566822016-12-15T13:14:20.010-05:002016-12-15T13:14:20.010-05:00Thanks for this. Helpful for someone like me just ...Thanks for this. Helpful for someone like me just beginning with R.<br /><br />Off topic but I was wondering if you could recommend any training providers in London. I work for an I Bank and so can get training budget for a couple of days of dedicated training. Just wondering if you had any thoughts?Angus Davidsonnoreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-48943845337982590212016-12-08T22:00:04.907-05:002016-12-08T22:00:04.907-05:00The latter was a great suggestion, I was actually ...The latter was a great suggestion, I was actually able to embed it into a DESeq2 analysis co-opting the way that heatmaps are handle outlier issues and applying it to this. Thanks again. Justin S. A. Perryhttp://www.blogger.com/profile/09364018797083066092noreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-33770033902940023332016-12-08T09:34:09.641-05:002016-12-08T09:34:09.641-05:00Hi Justin--
My first thought would be to handle t...Hi Justin--<br /><br />My first thought would be to handle this on a case-by-case basis, meaning to arbitrarily remove the large values by hand before plotting the data.<br /><br />But it would be an interesting exercise to construct a function to detect range issues like this. You could also embed the R code in a function and include an option to trim the n largest values before plotting.Ken Kleinmanhttp://www.blogger.com/profile/09525118721291529157noreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-61549830663867520322016-12-07T17:31:03.733-05:002016-12-07T17:31:03.733-05:00This is great, thanks. Is there a way to restrict ...This is great, thanks. Is there a way to restrict the Z value to limit outliers? All of my points are "significant" but even after log transforming I still have one or two points that are much larger than the others, dwarfing the majority of bubbles. <br /><br />Thanks!Justin S. A. Perryhttp://www.blogger.com/profile/09364018797083066092noreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-8820676692911213982016-12-06T01:03:22.274-05:002016-12-06T01:03:22.274-05:00Thanks for the R function. Is there a way to get t...Thanks for the R function. Is there a way to get the same table of observation as we get in SAS,for Hosmer Lemeshow test?<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-9227471414587991412016-12-03T20:02:46.600-05:002016-12-03T20:02:46.600-05:00Hi Edward-- I think this is easier/quicker. I onl...Hi Edward-- I think this is easier/quicker. I only need to install one program in Linux (in Amazon-- none if I use Digital Ocean). And the different docker images have various packages pre-installed, which I think might save a lot of time for a casual user.Ken Kleinmanhttp://www.blogger.com/profile/09525118721291529157noreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-76440241998223507422016-12-02T23:08:23.848-05:002016-12-02T23:08:23.848-05:00If all you want to do is host a personal RStudio S...If all you want to do is host a personal RStudio Server in the cloud, why do you need Docker? Why not just stand up an Ubuntu 16.04 server instance, install r-base, r-base-dev, git, gdebi-core and RStudio Server?M Edward Boraskyhttp://www.blogger.com/profile/00279858224379712739noreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-65460114481318426182016-10-22T01:43:22.844-04:002016-10-22T01:43:22.844-04:00Simply superb article thank youSimply superb article <a href="http://unitedtrainings.com/sas-online-training/" rel="nofollow"> thank you </a>Chinmaye Srihttp://www.blogger.com/profile/01655535342202271694noreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-9387014622412420442016-10-19T00:08:07.353-04:002016-10-19T00:08:07.353-04:00DreamHost is one of the best web-hosting provider ...<b><a href="http://hosting.syntaxlinks.com/r/DreamHost" rel="nofollow">DreamHost</a></b> is one of the best web-hosting provider <b>with plans for any hosting requirments</b>.Bloggerhttp://www.blogger.com/profile/07287821785570247118noreply@blogger.comtag:blogger.com,1999:blog-1275149608391671670.post-55064828816561175322016-10-13T19:36:33.851-04:002016-10-13T19:36:33.851-04:00Mr Ken Kleinman
I used your post how to generate ...Mr Ken Kleinman<br /><br />I used your post how to generate data from a logistic regression in SAS. Its very helpful posts for new users. I use your post of generating data from logistic regression I generate 1000 random numbers, Now I want to replicate this results 100 times, how i can do this. Any suggestions will be pretty helpful. ThanksAnonymousnoreply@blogger.com