Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to enforce the same parameter on monotonic effects #1599

Closed
ksuresh17 opened this issue Feb 15, 2024 · 4 comments
Closed

Add an option to enforce the same parameter on monotonic effects #1599

ksuresh17 opened this issue Feb 15, 2024 · 4 comments

Comments

@ksuresh17
Copy link

Related to #924, is it possible to restrict two monotonic effects to have both the same shape parameter (which is possible with the "id" specification) and the same effect parameter (b). The setting would be a situation where you have two structures x and y that you believe contribute the same effect (e.g., ax + ay). In a linear regression formula statement this can be specified as I(x+y). I would like to impose monotonicity on both of these structures, and use a specification like I(mo(x, id="s") + mo(y, id="s")) to restrict both the shape and effect parameter to be the same for both of these structures. I am currently getting the error The monotonic term I(mo(x, id="s") + mo(y, id="s")) is invalid. Possible to implement this in the formula statement somehow?

@jsocolar
Copy link
Contributor

jsocolar commented Feb 15, 2024

Doesn't mo(I(x+y)) do this? If not, you could always just define a new column in your input data and populate it with the values x + y.

@ksuresh17
Copy link
Author

Since x and y need to be ordered factors to include as monotonic predictors I can't use the definition x+y directly either in the formula specification or by creating a new variable in the data set.

@jsocolar
Copy link
Contributor

silly me, sorry for the noise. Note that I doesn't mean "force equality of coefficients" but rather "isolate the expression and evaluate using standard R syntax and not formula-specific syntax".

@paul-buerkner
Copy link
Owner

It is not yet possible but may become possible in the future as part of a general equal() prior option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants