Re: [R] [External] Creating model formulas programmatically

2025-04-05 Thread Bert Gunter
Thanks, Rich. I thought of that, too, but it violates the spirit of my restraints (to avoid character strings), which I unfortunately did not clearly articulate. So my apologies for that failure. My concern is that with more complex model formula, using as.formula, etc. to parse/convert character

Re: [R] how to create model matrix of second order terms

2025-04-05 Thread Ben Bolker
I'm still not entirely clear what you want, in particular what you want to with factor variables ('squaring' them doesn't really seem to make sense). Some combination of sprintf/paste/reformulate might do what you want: ## get all second-order terms (doesn't square numeric values) quad_terms

Re: [R] join/merge two data frames

2025-04-05 Thread avi.e.gross
Arnaud, I won't comment on other aspects but want to ask how sure you are that your data is guaranteed to have a single row reflecting a closing price at 18:59:59 exactly? It may be true for your data source. I note that markets technically close at 4:00 PM, New York time, but many have after-

Re: [R] join/merge two data frames

2025-04-05 Thread Bert Gunter
You might do better posting here: https://stat.ethz.ch/mailman/listinfo/r-sig-finance Cheers, Bert "An educated person is one who can entertain new ideas, entertain others, and entertain herself." On Wed, Apr 2, 2025 at 4:39 PM Arnaud Gaboury wrote: > I will try to be more precised. Here is

Re: [R] Setting up hypothesis tests with the infer library?

2025-04-05 Thread Kevin Zembower via R-help
Hi, Rui and Michael, thank you both for replying. Yeah, I'm not supposed to know about Chi-squared yet. So far, all of our work with hypothesis tests has involved creating the sample data, then resampling it to create a null distribution, and finally computing p-values. The prop.test() would work

Re: [R] how to create model matrix of second order terms

2025-04-05 Thread Ebert,Timothy Aaron
You could try writing code to write code. However, you need to tell the program which variables are factor and which are continuous. If you are lucky and all integer data are factor and all non-integers are continuous, then you can sort for that. However, in a broad data perspective this is a ba