r - Specifying lag in `dlnm` when passing arguments to `crossbasis` -
I am using the dlnm
package to create a limited distributed interval non linear model. I intend to test the ideal fit based on various lag levels, from which it shows which interval is appropriate. There is no need to mention that I will implement some domain knowledge to make a good call. I am using these two available resources, which is to accomplish this complex task:
I have created the matrix for the first time, in which both of these are my predictions -Using linear effects: Impressions AX & Lt; -onebasis (locanatmodelset $ ImpressionsA.x, Fun = "poly", degree = 2)
Impressions AA & Lt; -onebasis (locanatmodelset $ ImpressionsA.y, fun = "shift", degree = 2)
Since my non-linear relationship is going to be quadratic, I am using 2 degree polynomials . Now I want to factor in the lac for each variable by calling on crossbasis
. This is where I am confused. According to package documentation, the function format is: cb
My suspicion is:
1) in lag = 30
is 30 of the same units as my reaction variable or is it my processor Will be in the units of the variable? In my case, my interval is specified in the day. I want to specify 5 days as lag before fit the model. How should I pass this argument?
2) Since I have already created my base matrix for the predator variable using acabus
, let me argue how ARGLAG
?
3) I also wanted to remove the inclination values of my predictive variable (Impressance AX and Impressance AI) in my parent units. The matrix itself is not useful, it turns everyone into negative values on some other scale.
I used the tag lm
& amp; For glm
question because dlnm
is not created
Sometimes look at this post, and hopefully my experience in using the DLN package can help you.
1) Interval = logic predictors in the crossbasis () function. In your case, you can only use lag = 5. 2) Acrobat () function has no direct use for DLNM fitting. Do you really need to adopt the crossbayce () function, and the arguments and arguments to set the base function for your exposure and the cross -Babs are very important for intervals within the function. Thus, they are not ignorable.
3) I am unsure what is the main purpose of removing the values inclined in your processor variable, but you can use only one interval () function to complete externally. There is no need to use DLN to do this.
Comments
Post a Comment