ASA Connect

 View Only
Expand all | Collapse all

F value needed to overcome loss in df

  • 1.  F value needed to overcome loss in df

    Posted 02-11-2016 23:29

    Dear Listmates, 

    I'm interested in establishing some criteria to keep a variable in a linear model that is not significant, but nonetheless eats up enough error to overcome the loss in degrees of freedom and improves ones ability to detect effects in the other variables in the model. I am interested in your reactions to the idea, especially if you can supply a reference.

    I've heard about some people using a 1 df f-value such as 1.2 but I have not found any literature on the topic and I could use your suggestions. 

    Thank you for your replies. 

    Sincerely, 

    KeithC. 

    ------------------------------
    Keith Chamberlain
    Analytical Chemist
    ------------------------------


  • 2.  RE: F value needed to overcome loss in df

    Posted 02-12-2016 02:05

    Hey Keith,

    It sounds like you are performing a multiple linear regression.

    What are the VIF for each term in your model? 

    What is your criteria for removing the term? 

    What is your response variable? Are you using the right transform?

    ------------------------------
    Andrew Ekstrom



  • 3.  RE: F value needed to overcome loss in df

    Posted 02-12-2016 20:02

    Dear Listmates, 

    I was hoping for a quick rule of thumb for the f-value associated with the addition of one term to increase power for detecting an effect in another parameter of interest. It sounds like the answer is 'it depends'. Oh well. Thanks for your time. 

    Sincerely, 

    KeithC. 

    ------------------------------
    Keith Chamberlain
    Analytical Chemist



  • 4.  RE: F value needed to overcome loss in df

    Posted 02-13-2016 16:41

    When you are dealing with linear models, there is a lot of nuance. 

    It's like asking, " What are the best settings for the analysis of. ....?" You need to know what instrument, column type and length, matrix of absorbsion, etc. Without that info, the only answers to give are:

    It's depends

    On this instrument, do this, on this instrument do this,...

    I've had some issue come up like yours. The answer depends upon a lot of things. For example, if your response is a concentration, you should use a Poisson regression. If your response is % recovery, you should use a logit regression. If you use multiple linear regression, you can get a model that looks good. Looks good doesn't mean it is good. The change in model assumption can have an effect on the final model. If you know what the answer should be, you can look at the model and see if it is "correct". If you don't know, you can end up going down the wrong path. 

    I have seen some models where you add in one or more variables, and others become significant. Someone else mentioned confounding. My model had that. There is also an issue of not using an interaction when appropriate. My model had that too. There is also an issue of highly correlated variables  (High VIF). My model had that too. 

    I'm actually writing a paper on this for JSE. 

    ------------------------------
    Andrew Ekstrom



  • 5.  RE: F value needed to overcome loss in df

    Posted 02-13-2016 17:54

    Dear Andrew, 

    Relating back to analytical chemistry sure helped. Indeed, I understand the need for nuance there. I know I have very high vifs because I'm working with a calibration model that I want to add a control variable to. I mistakenly thought I could get away with ignoring the nuances. It sounds like some of them you have encountered as well. Looking forward to your paper. Thank you for your feedback!

    Sincerely, 

    KeithC. 

    ------------------------------
    Keith Chamberlain
    Analytical Chemist



  • 6.  RE: F value needed to overcome loss in df

    Posted 02-14-2016 04:09

    What type of calibration are you working on? What book(s) are you using for reference?

    One of the data sets I worked with allowed me to "correct" data that was "outside the lines" on the QC chart. I created a model that included 2 factors for my test, run position and "day". Run position is the number of the sample I ran that day. Day is a generic term for what ever day I ran the sample on. Since there is no reason for "Tuesday" to always be biased in one direction and "Wednesday" to be biased in another direction, I just called them 'day'. What I found was that each day has a new starting point. But, the increased reported response was about 0.50% per sample I ran. So, Run #1 might be 7.00. Run #10 would be 7.00 + 10*(0.5% of 7.00) or about 7.35. By subtracting the average increased response and the daily bias, I was able to decrease the standard deviation of my samples by 50%.   

    There is a trick you can use to reduce some of the correlation among different terms in a model. It goes by a few different names. I think "centering" is most appropriate. You basically subtract the mean of a factor from every value in that column. If you have a quadratic term in the model, you then create a quadratic term from this "centered" factor. 

    For example, suppose you have the (X, X^2) pairs of data: (0,0), (2, 4), (4,16), (6, 36), (8, 64), (10,100)

    If you center your 'X' values, you get -5, -3, -1, 1, 3, 5. Your new X^2 values are 25, 9, 1, 1, 9, 25. The VIF for the original values are high. The VIF for the "centered" values are now 1.00. 

    It would surprise me if you could share the data you are working on with us. Would it be possible to share "similar" data? If you take your original data, both the independent and dependent variables and divide it all by some value, known only to you, should give us an idea about what type of issues you will have and the data will be sufficiently different that you won't give away any important info. 

    For example, your factor levels could be 0.05ppb, 0.10ppb, 0.25ppb, 0.50ppb, 1.00ppb and the new levels could be 1.00, 2.00, 5.00, 10.00, 20.00. The new response could be 20*original or keep the original response the way it is. 

    BTW, have you decided if you want to pursue a degree in stats or a related area? If you are working as a chemist in industry, it might make sense to go for an MS in Industrial Engineering and focus on quality control/reliability. Despite the old BASF tagline, IE's really are the one's that, "Make the products you buy, better." It's also best to get them involved early on.  

    ------------------------------
    Andrew Ekstrom



  • 7.  RE: F value needed to overcome loss in df

    Posted 02-15-2016 21:58
    Edited by Keith Chamberlain 02-15-2016 22:35

    Dear Andrew, thank you for your reply. 

    I'm calibrating a residual solvents static headspace experiment and have found that there is no such thing as static, if I look at the ppm difference in model predictions between a model that takes the headspace volume into account and one that doesn't. I've also found that generally for calibrations,  if enough points are used, there is a violation of equal variance across the calibrated range, so I've had to use transforms also. I'm using "Static headspace has chromatography, 2nd ed" by Bruno Kolb and Leslie Ettre as my seminal work. "Data Analysis: A model comparison approach 2nd ed.", by 'Chick' Judd, Gary McClelland & Carry Ryan. Several Pharma method validation books that turn out to be very weak on their stats. AAC0215 Shared.csv

    Sincerely, 

    KeithC. 

    ------------------------------
    Keith Chamberlain
    Analytical Chemist



  • 8.  RE: F value needed to overcome loss in df

    Posted 02-16-2016 03:42

    Hey Keith,

    I'm looking over the data now. Several of the variables in your data set are highly correlated with each other. Without knowing exactly what each header means, I get the idea that some columns are multiples of other columns. ISAmtAdj is related to ISConcAdj. ResponseAdj is related to AmountAdj. DMIAmtAdj is related negatively to Level, AmountAdj, and STDAmtAdj.etc. 

    What is your response variable in this data? I'd assume Level or AmountAdj.   

    To me, it looks like ISConcAdj and ResponseAdj might be the only 2 factors to regress against  Level/AmountAdj. 

    Does that sound about right to you? 

    I see that you told Eric you are running Y = Conc + Conc^2 + Other. When you include a quadratic term in your model, you will have issues with a high VIF. This can bring up an issue with your model. Something I have found that helps this issue is to subtract the mean of the conc and create a new factor, "centered conc" (CC). Then try running a new model with Y = CC + CC^2 + Other. 

    Also, are you randomly choosing what samples to look at? The data set you shared has 72 data points. Some of the models seem to indicate that groups of say 12-15 are run under similar circumstances at the beginning. 

    Something I found I had to do with my instruments was to randomize the order of the standards and run them on different days. So, if I had standards 1, 2,3, 4, 5, I'll run them 1,3,5,4,2, then 4,3,5,1,2.... I've noticed most (by most I mean all that I tested) of my instruments tend to add a bit to the response as the day goes on. 

    I look forward to your answers. 

    ------------------------------
    Andrew Ekstrom



  • 9.  RE: F value needed to overcome loss in df

    Posted 02-16-2016 09:59

    Dear Andrew,

    I have not yet used the internal standard concentration/responses. ISAmtAdj and ISConcAdj are related. One is the amount of internal standard stock used at that level, and the other is the concentration of the actual internal standard (Ethylbenzene) in the sample derived from ISAmtAdj that one would need to know how the IS is prepped in order to get. I imagine when I do get around to using them it would be like how Agilent does it, the analyte amount divided by the ISConcAdj regressed on the instrument response divided by the IS response to come up with a response ratio and an amount ratio. For now though, I'm just doing an external standard calibration.

    DMIAmtAdj would be inversely related to STDAmtAdj. Because this is 'static' headspace, as the amount of the standard increases in the solution, I have to lower the amount of my carrier solvent to compensate. This is why I was using the differenced sum of DMIAmtAdj, ISAmtAdj, STDAmtAdj as a control variable and not DMIAmtAdj. That sum should not be related to ResponseAdj, even in a model that controls for AmountAdj and AmoutnAdj^2. If it is, ever so slightly, then that should improve my predictions of AmountAdj in the inverse calibration by at least a few ppm. This is what I was hoping to detect with the F-test for a full model compared to a model that drops that sum.

    If I understand correctly, I do not want to mean deviate AmountAdj because then I would be fitting the curve at the mean of AmountAdj instead of somewhere closer to the origin, and this is a trace level (tens of ppm here anyway) test.

    I am using all of the data and not randomly sampling.

    Technically, not all injections took place on the same day, and the order was not randomized. That is a limitation of the current design.

    Sincerely,

    KeithC.

    ------------------------------
    Keith Chamberlain
    Analytical Chemist



  • 10.  RE: F value needed to overcome loss in df

    Posted 02-18-2016 03:32

    So, if I understand you correctly, you are modeling ResponseAdj vs AmountAdj/Level. It also looks like you run 10 samples per day. It also looks like the variability of samples increases quite a bit around sample 40 for the model AmountAdj = ResponseAdj + ResponseAdj^2. R^2Adj = 98.97% and the residuals look horrible. I see some issues with fit vs order plot too. The points in row 51 and 61 look like extreme outliers too. 

    I created a new variable called Day. Run 1- 10 are in Day 1, 11-20->Day 2, 21-30->Day 3, etc. 

    I think the best model I made for your data was:

    Sqrt(AmountAdj) = ResponseAdj + ResponseAdj^2 + Day. R^2(adj) 100.00%

    The problem is, Day is highly correlated to ResponseAdj. The residuals still look bad too. Maybe correcting by the IS will help with that. 

    If I had to guess, there was an issue with your instrument on the first few days of sampling. 

    ------------------------------
    Andrew Ekstrom



  • 11.  RE: F value needed to overcome loss in df

    Posted 02-18-2016 20:09

    Dear Andrew, 

    Thank you for your look at the data. Indeed, there are some outliers and the diagnostics look horrendous for the untransformed data.  I cannot say I ran 10 samples/day as most days had multiple sets of 10 ran. The chromatogram files all have time stamps. It sounds like you're suggesting I dig those dates/times out, if I continue to try and use these data. 

    You're right, day would be correlated with respAdj. As the days progressed I ran higher concentrations.

    I can see why you'd suspect an instrument problem for the first few days. Those were at 2 to 3 times signal to noise so the integrations varied a lot. In all, messy data. Believe it or not, however, I can argue for an appropriate transform that is somewhere between root 2 and log 10 (root 0.2) on both respAdj and AmtAdj that takes care of the non constant variance and non normality (enough, in my opinion that is).

    I should note that I'm not using level. Perhaps I can email you individually about your day variable using a smaller/cleaner calibration set. As time went on (half a year) I lost all sensitivity for acetic acid on the assay and had to adopt a different method. The reasons remain a mystery even to the Agilent application engineers, but we suspect active sites in the instrument inlet/column/transfer line. It's ok. The new method is far superior.

    Let me know what you think about the justifiability of the transform I chose. 

    Sincerely, 

    KeithC. 

    ------------------------------
    Keith Chamberlain
    Analytical Chemist



  • 12.  RE: F value needed to overcome loss in df

    Posted 02-20-2016 02:45
    Edited by Andrew Ekstrom 02-21-2016 03:03

     

    If you ran multiple replicate samples per day, you might be able to use those samples to look for issues with a rising or falling baseline. 

    A couple other questions

    1) how many levels do you need?

    2) What range are you calibrating?

    3) What do your ccvs on this instrument look like?

    4) when you say you ran replicates, did you make say 3+ standards and run on vial from each standard or run the same vial 3+ times?

    Also, have you looked into Applied Stats or IE programs? Several high quality programs offer online stats certificates if an MS is more than you want. (Penn State, U of Rochester, Colorado State, etc) I'm willing to bet that if you took a course or 2 in Design of Experiments and Statistical Quality Control, you'd be able to apply those ideas in your lab and come up with a better way of detecting issues with your equipment. 

    If it comes through, I have a graph of the CCVs from a QC experiment I ran on my GC-FID. This is the same standard used on all 11 days. Most days, the response of the CCV increases between the first and second sample. Sometimes it goes back down after that. According to the QC protocol I was dealing with at this time, each sample is "between the lines" so it is good to go. Clearly, when you look at the CCV data on a day by day basis, there are some issues.

    Speaking of which, if you create a new variable, "Run", and you create some groups based upon Run 1-10=> Group 1, 11-20=> Group 2, 21-30 =>Group 3, etc, and plot them by group, you'll see some interesting things. 

     

    ------------------------------
    Andrew Ekstrom



  • 13.  RE: F value needed to overcome loss in df

    Posted 02-12-2016 11:25

    Dear Keith,

    Two major criteria relate to the scientific relationships more than the numbers: 1) Will you be expected to account for differences related to the variable when describing results (sometimes called "confounding")? and 2) Is the variable known to affect the relationship between another variable in the linear model and the outcome (sometimes called "effect modification", and involves interaction terms)? In either of these situations we tend to keep the variable in the model even when its coefficient is not statistically significant, because that lack of significance may be associated more with lack of power to detect an effect than lack of an effect itself.

    ------------------------------
    Alicia Toledano
    President
    Biostatistics Consulting, LLC



  • 14.  RE: F value needed to overcome loss in df

    Posted 02-12-2016 14:54

    In general, I don't recommend particular things to be done without having all of the details.  Good statistics requires thorough understanding of the research background, objectives of the study in question, the data, etc.  However, there are some things that seem generally inadvisable such as basing a decision merely on the arithmetic.  If one is worried about the loss of a degree or two of freedom in the error term, then it seems to me that it would be likely that there is some serious over-fitting.  I believe that one should be careful about the use of the word "significant."  It might mean statistically significant, but at what alpha level?  It might mean having some kind of practical importance.  Note that statistically significant for a pre-specified primary endpoint at a pre-specified alpha is one thing and a nominally statistically significant regression coefficient in an exploratory analysis is something quite different.  This also brings up the issue of whether the value of a regression model for prediction (as opposed to hypothesis testing) should be judged in terms of p-values and pre-specified alpha levels or should be judged in terms of confidence intervals for regression coefficients and the unique contributions to R-squared, all this with due consideration to what makes sense from what we already know scientifically about the variables in question.



    ------Original Message------

    Dear Listmates, 

    I'm interested in establishing some criteria to keep a variable in a linear model that is not significant, but nonetheless eats up enough error to overcome the loss in degrees of freedom and improves ones ability to detect effects in the other variables in the model. I am interested in your reactions to the idea, especially if you can supply a reference.

    I've heard about some people using a 1 df f-value such as 1.2 but I have not found any literature on the topic and I could use your suggestions. 

    Thank you for your replies. 

    Sincerely, 

    KeithC. 

    ------------------------------
    Keith Chamberlain
    Analytical Chemist
    ------------------------------


  • 15.  RE: F value needed to overcome loss in df

    Posted 02-13-2016 20:28

    About using a 1-df F-value such as 1.2, I need to ask: what F test is being conducted?

    What I'm thinking is, there is a F test for assessing variables added to the model that's based on comparing error sums of squares for the full model versus the reduced model. If one computed the F-statistic for this test, and then subtracted off twice the df of the variable being assessed, the result would be analogous to comparing Akaike Information Criterions (AICs) between full and reduced models in a procedure that displays AICs in its fit statistics. But I don't have a reference for that.

    The other thing I'm thinking is, if the added variable eat up enough error to overcome the loss in degrees of freedom, then adding it should reduce the mean-square error; yes? Which looks like a good thing from your point of view; yes? So perhaps the more direct approach would be to establish your criteria using mean square error instead of an F statistic.

    ------------------------------
    Eric Siegel, MS
    Research Associate
    Department of Biostatistics
    Univ. Arkansas Medical Sciences



  • 16.  RE: F value needed to overcome loss in df

    Posted 02-15-2016 19:44
    Edited by Keith Chamberlain 02-16-2016 02:36

    Hi Eric, thank you for your reply. 

    I am running f-tests from a full model compared to a reduced model that has one fewer parameters in it.

    Area=conc+conc^2+(mean deviated total Amt) compared to a model that drops mean deviated total amount, in a headspace experiment. Indeed,  what I was trying to establish was a cutoff for what you said, essentially a reduction in mean squared error where the parameter added increases the power to detect effects in other parameters ever so slightly.

    I haven't thought about using the aic to do it,  or simply stick to the mse reduced as a criterion. I figured that since I'm doing a 1 df test that the f-value would be transferable to other 1 df models and thus at least the approach should generalize (for type iii sum of squares comparisons anyway). Like you said, if the variable eats up error it should be a good thing. I've found much resistance to the idea here, however. 

    Sincerely, 

    KeithC. 

    ------------------------------
    Keith Chamberlain
    Analytical Chemist