We use the two-point correlation function in redshift space , \xi ( s ) , to study the clustering of the galaxies and groups of the Nearby Optical Galaxy ( NOG ) sample , which is a nearly all-sky ( |b| > 20 ^ { \circ } ) , complete , magnitude-limited sample of \sim 7000 bright and nearby optical galaxies ( cz \leq 6000 km/s ) . The correlation function of galaxies is well described by a power law , \xi ( s ) = ( s / s _ { 0 } ) ^ { - \gamma } , with slope \gamma \sim 1.5 and s _ { 0 } \sim 6.4 h ^ { -1 } Mpc ( on scales 2.7 - 12 h ^ { -1 } Mpc ) , in substantial agreement with previous results of several redshift surveys of optical galaxies . Splitting NOG into different morphological subsamples , we confirm the existence of morphological segregation between early- and late-type galaxies ( out to 20 h ^ { -1 } Mpc ) and , in particular , we find a gradual decreasing of the strength of clustering from the S0 galaxies to the late-type spirals , on intermediate scales ( around 5 h ^ { -1 } Mpc ) . The relative bias factor between early- and late-type galaxies appears to be substantially constant with scale . Furthermore , luminous galaxies turn out to be more clustered than dim galaxies . The luminosity segregation , which is significant for both early- and late-type objects , starts to become appreciable only for galaxies brighter than M _ { B } \sim - 19.5 + 5 \log h ( \sim 0.6 L ^ { * } ) and is independent on scale . The NOG groups identified with the hierarchical and percolation algorithms show similar clustering properties , with a degree of clustering which is intermediate between galaxies and clusters . The group correlation functions are characterized by s _ { 0 } -values ranging from \sim 8 h ^ { -1 } Mpc ( for groups with at least three members ) to \sim 10 h ^ { -1 } Mpc ( for groups with at least five members ) . The degree of group clustering depends on the physical properties of groups . Specifically , groups with greater velocity dispersions , sizes and masses tend to be more clustered than those with lower values of these quantities .