Programming the statistical procedures from SAS

How to use the by statement in Proc Panel

Reply
N/A
Posts: 1

How to use the by statement in Proc Panel

Disclaimer: Undergrad student learning how to use SAS

So I'm doing proc panel using data that looks like this

YearStateVehicle Miles Traveled per driverPopulation DensityCenterline Miles DensityLane Miles Density
2002Alabama16074.6855988.587382761.864626323.863757528
2003Alabama16296.955588.868634611.864626323.863816764

2002Alaska10193.73511.1281804150.0247405990.050168144
2003Alaska10264.03621.1369985680.0249368690.050550171

I use the following to get some coefficients

proc sort data=WithInteractionEffects;

  by state year;

  run;

proc panel data = WithInteractionEffects;

  id state year;

  model vehicle_miles_traveled_per_drive = population_density centerline_miles_density lane_miles population_centerline_density population_lane_density centerline_lane_density;

run;

I want to include

by state;

So that it will give me regression coefficients for each state rather than just the whole thing.

Currently, when I try that it gives me

ERROR: There is only one cross section or time series observation. Computations will be

       terminated

So is there a way to achieve the result that I want?

Ask a Question
Discussion stats
  • 0 replies
  • 110 views
  • 0 likes
  • 1 in conversation