BookmarkSubscribeRSS Feed
mattdh88
Calcite | Level 5

linfit=Fit Model(

      Y( :PT ),

      Effects( :Pts 2 ),

      Personality( Standard Least Squares ),

      Run model

);

linfit<<prediction formula;

I have a simple script using a fit model that saves the prediction formula to my current data table. It looks at a basketball player's points scored on a given night vs. what the opponent's defense typically allows. In the table, there are multiple players and duplicate values for each player. Instead of fitting a linear regression for all players and using one prediction formula, I'd like to fit a linear regression for each individual player, so that there are multiple prediction formulas within one column. When I let JMP create the script for me, the script just runs over and over with a "where player = X" clause for each player. The players change on a regular basis so this can't be used. I thought I could just add a "Group by(:players)," line after Effects(:Pts 2) but that isn't grouping anything for me. How do I go about using group by in a fit model script?

1 REPLY 1
PGStats
Opal | Level 21

Please post your question to the JMP community forum

https://community.jmp.com/welcome

PG

PG

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1402 views
  • 0 likes
  • 2 in conversation